Skip to content

Commit c48b799

Browse files
authored
Fixes #3081 build on github (#3082)
* Fixes #3081 build on github * update package versions * update dependencies for resolver project * update readme * remove version * spacing * include runtime identifier * enable coverage for debugging * remove matlab tests from coverage * enable nightly for debugging * temporarily disable time check * remove tests temporarily * use nuget to restore * typos * typo * remove command chaining * quote * pk-sim * remove temporaries * postclean 12.1 * nuget restore
1 parent ef4a9ee commit c48b799

26 files changed

+325
-680
lines changed

.github/workflows/build-and-test.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
pull_request:
8+
branches:
9+
- develop
10+
11+
env:
12+
MAJOR: 12
13+
MINOR: 1
14+
RUN: ${{ github.run_number }}
15+
16+
jobs:
17+
18+
build:
19+
runs-on: windows-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
submodules: 'true'
25+
26+
- name: Add msbuild to PATH
27+
uses: microsoft/setup-msbuild@v2
28+
29+
- name: Restore dependencies
30+
run: |
31+
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"
32+
nuget sources add -name bddhelper -source https://ci.appveyor.com/nuget/ospsuite-bddhelper
33+
nuget sources add -name utility -source https://ci.appveyor.com/nuget/ospsuite-utility
34+
nuget sources add -name serializer -source https://ci.appveyor.com/nuget/ospsuite-serializer
35+
nuget sources add -name databinding -source https://ci.appveyor.com/nuget/ospsuite-databinding
36+
nuget sources add -name texreporting -source https://ci.appveyor.com/nuget/ospsuite-texreporting
37+
nuget sources add -name databinding-devexpress -source https://ci.appveyor.com/nuget/ospsuite-databinding-devexpress
38+
nuget restore
39+
40+
- name: Build
41+
run: msbuild PKSim.sln /p:Version=12.1.9999
42+
43+
- name: Test
44+
run: dotnet test .\tests\**\bin\Debug\net472\PKSim*Tests.dll -v normal --no-build --logger:"html;LogFileName=../testLog_Windows.html"
45+
46+
- name: Push test log as artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: testLog_Windows
50+
path: ./testLog*.html

.github/workflows/build-nightly.yml

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

.github/workflows/coverage.yml

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

0 commit comments

Comments
 (0)