Skip to content

Commit cbe6214

Browse files
committed
Fixes #3081 build on github
1 parent ef4a9ee commit cbe6214

File tree

7 files changed

+219
-190
lines changed

7 files changed

+219
-190
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- develop
8+
9+
env:
10+
MAJOR: 12
11+
MINOR: 1
12+
RUN: ${{ github.run_number }}
13+
14+
jobs:
15+
16+
build:
17+
runs-on: windows-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: 'true'
23+
24+
- name: Add msbuild to PATH
25+
uses: microsoft/setup-msbuild@v2
26+
27+
- name: Restore dependencies
28+
run: |
29+
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
30+
nuget sources add -name bddhelper -source https://ci.appveyor.com/nuget/ospsuite-bddhelper
31+
nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
32+
nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
33+
nuget sources add -name databinding -source https://ci.appveyor.com/nuget/ospsuite-databinding
34+
nuget sources add -name texreporting -source https://ci.appveyor.com/nuget/ospsuite-texreporting
35+
nuget sources add -name databinding-devexpress -source https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
36+
dotnet restore
37+
38+
- name: Build
39+
run: msbuild PKSim.sln /p:Version=12.1.9999
40+
41+
- name: Test
42+
run: dotnet test .\tests\**\bin\Debug\net472\PKSim*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
43+
44+
- name: Push test log as artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: testLog_Windows
48+
path: ./testLog*.html
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Changing the workflow name will reset the run number
2+
name: Build Nightly 12.1
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 2 * * *'
8+
9+
10+
env:
11+
MAJOR: 12
12+
MINOR: 1
13+
RUN: ${{ github.run_number }}
14+
TARGET_FRAMEWORK: net8
15+
16+
jobs:
17+
get-latest-commit-timespan:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
LATEST_COMMIT_TIMESPAN: ${{ steps.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN}}
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Get the previous commit timespan
28+
id: get-latest-commit-timespan
29+
shell: bash
30+
run: |
31+
commit=$(git log origin/develop -1 --format="%at")
32+
echo $commit
33+
now=$(date +%s)
34+
echo $now
35+
timespan=$[now - commit]
36+
echo "Timespan: ${timespan}"
37+
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_ENV
38+
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_OUTPUT
39+
40+
build-nightly:
41+
needs: get-latest-commit-timespan
42+
if: needs.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN < 86400
43+
runs-on: windows-latest
44+
steps:
45+
- name: Checkout code
46+
uses: actions/checkout@v4
47+
with:
48+
submodules: 'true'
49+
50+
- name: Add msbuild to PATH
51+
uses: microsoft/setup-msbuild@v2
52+
53+
- name: Restore dependencies
54+
run: |
55+
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
56+
nuget sources add -name bddhelper -source https://ci.appveyor.com/nuget/ospsuite-bddhelper
57+
nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
58+
nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
59+
nuget sources add -name databinding -source https://ci.appveyor.com/nuget/ospsuite-databinding
60+
nuget sources add -name texreporting -source https://ci.appveyor.com/nuget/ospsuite-texreporting
61+
nuget sources add -name databinding-devexpress -source https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
62+
dotnet restore
63+
64+
- name: define env variables
65+
run: |
66+
echo "APP_VERSION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.RUN }}" | Out-File -FilePath $env:GITHUB_ENV -Append
67+
68+
- name: Build
69+
run: |
70+
rake "update_go_license[ApplicationStartup.cs, ${{ secrets.GO_DIAGRAM_KEY }}]"
71+
msbuild PKSim.sln /p:Version=${{env.APP_VERSION}}
72+
73+
- name : Test
74+
run: dotnet test .\tests\**\bin\Debug\net472\PKSim*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
75+
76+
- name: Create Setup
77+
run: |
78+
rake "create_setup[${{env.APP_VERSION}}, Debug]"
79+
rake "create_portable_setup[${{env.APP_VERSION}}, Debug, pk-sim-portable-setup.zip]"
80+
81+
- name: Create R dependency artifact
82+
run: |
83+
pushd . &&
84+
cd src\PKSimRDependencyResolution\bin\%CONFIGURATION%\%TARGET_FRAMEWORK% &&
85+
7z.exe" a pk-sim-r-dependencies.zip -x@excludedFiles.txt * -xr!runtimes &&
86+
popd
87+
88+
- name: Push test log as artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: testLog_Windows
92+
path: ./testLog*.html
93+
94+
- name: Push nightly installer as artifact
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: PKSim Installer ${{env.APP_VERSION}}
98+
path: setup\deploy\*.msi
99+
100+
- name: Push nightly portable as artifact
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: PKSim Portable ${{env.APP_VERSION}}
104+
path: setup\PKSim ${{env.APP_VERSION}}
105+
106+
- name: Push R dependencies as artifact
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: PKSim R Dependencies
110+
path: src\PKSimRDependencyResolution\bin\Debug\${{env.TARGET_FRAMEWORK}}\pk-sim-r-dependencies.zip

.github/workflows/coverage.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Code Coverage
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * 5'
6+
7+
jobs:
8+
cover:
9+
runs-on: windows-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
submodules: 'true'
15+
16+
- name: Add msbuild to PATH
17+
uses: microsoft/setup-msbuild@v2
18+
19+
- name: Restore dependencies
20+
run: |
21+
nuget sources add -username Open-Systems-Pharmacology -password ${{ secrets.GITHUB_TOKEN }} -name OSP-GitHub-Packages -source "https://nuget.pkg.github.com/Open-Systems-Pharmacology/index.json"
22+
nuget sources add -name bddhelper -source https://ci.appveyor.com/nuget/ospsuite-bddhelper
23+
nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
24+
nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
25+
nuget sources add -name databinding -source https://ci.appveyor.com/nuget/ospsuite-databinding
26+
nuget sources add -name texreporting -source https://ci.appveyor.com/nuget/ospsuite-texreporting
27+
nuget sources add -name databinding-devexpress -source https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
28+
dotnet restore
29+
30+
- name: Build
31+
run: msbuild PKSim.sln /p:Version=12.1.999
32+
33+
34+
- name: Cover and report
35+
uses: Open-Systems-Pharmacology/Workflows/.github/actions/dotCover@main
36+
with:
37+
xml-configuration: dotcover.xml
38+
token: ${{ secrets.CODECOV_TOKEN }}

appveyor-coverage.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

appveyor-nightly.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)