Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Test

on:
push:
branches:
- develop
pull_request:
branches:
- develop

env:
MAJOR: 12
MINOR: 1
RUN: ${{ github.run_number }}

jobs:

build:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Restore dependencies
run: |
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"
dotnet restore

- name: Build
run: dotnet build InstallationValidator.sln /p:Version=12.1.9999

- name: Test
run: dotnet test .\tests\**\bin\Debug\net472\InstallationValidator*Tests.dll --filter “TestCategory!=Reporting” --no-build -v normal --logger:"html;LogFileName=../testLog_Windows.html"

- name: Push test log as artifact
uses: actions/upload-artifact@v4
with:
name: testLog_Windows
path: ./testLog*.html
99 changes: 99 additions & 0 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Changing the workflow name will reset the run number
name: Build Nightly 12.1

on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'

env:
MAJOR: 12
MINOR: 1
RUN: ${{ github.run_number }}
TARGET_FRAMEWORK: net8

jobs:
get-latest-commit-timespan:
runs-on: ubuntu-latest
outputs:
LATEST_COMMIT_TIMESPAN: ${{ steps.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN}}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get the previous commit timespan
id: get-latest-commit-timespan
shell: bash
run: |
commit=$(git log origin/develop -1 --format="%at")
echo $commit
now=$(date +%s)
echo $now
timespan=$[now - commit]
echo "Timespan: ${timespan}"
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_ENV
echo "LATEST_COMMIT_TIMESPAN=${timespan}" >> $GITHUB_OUTPUT

build-nightly:
needs: get-latest-commit-timespan
# the build-nightly job should be run in 2 cases:
# - either the workflow was triggered manually (on 'workflow_dispatch')
# - or the workflow was triggered on schedule and last repository commit is not older than 24h (=86400 sec)
if: needs.get-latest-commit-timespan.outputs.LATEST_COMMIT_TIMESPAN < 86400 || github.event_name == 'workflow_dispatch'
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'

- name: Restore dependencies
run: |
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"
nuget restore

- name: define env variables
run: |
echo "APP_VERSION=${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.RUN }}" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Build
run: |
dotnet build InstallationValidator.sln /p:Version=${{env.APP_VERSION}}

- name: Test
run: dotnet test .\tests\**\bin\Debug\net472\InstallationValidator*Tests.dll --filter “TestCategory!=Reporting” --no-build -v normal --logger:"html;LogFileName=../testLog_Windows.html"

- name: Create Setup
run: |
rake "create_setup[${{env.APP_VERSION}}, Debug]"

- name: Push test log as artifact
uses: actions/upload-artifact@v4
with:
name: testLog_Windows
path: ./testLog*.html

- name: Push nightly installer as artifact
uses: actions/upload-artifact@v4
with:
name: Installation Validator Installer ${{env.APP_VERSION}}
path: setup\deploy\*.msi

cleanup-job:
needs: build-nightly
# run only if the build-nightly job was skipped
if: always() && needs.build-nightly.result == 'skipped'
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cancel workflow run
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,5 @@ ModelManifest.xml
.paket/paket.exe

# FAKE - F# Make
.fake/
.fake/
*.ncrunchsolution
8 changes: 4 additions & 4 deletions InstallationValidator.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.16
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallationValidator", "src\InstallationValidator\InstallationValidator.csproj", "{5CFD54EC-23C4-49DA-8E97-0215F9076F3D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallationValidator.Tests", "tests\InstallationValidator.Tests\InstallationValidator.Tests.csproj", "{AD493FBC-936F-44A1-AE88-D103EA2DF5B8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1EE126C4-E171-479C-B79A-0B5B1BBC50FC}"
ProjectSection(SolutionItems) = preProject
appveyor-nightly.yml = appveyor-nightly.yml
appveyor.yml = appveyor.yml
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
.github\workflows\build-nightly.yml = .github\workflows\build-nightly.yml
rakefile.rb = rakefile.rb
README.md = README.md
setup\setup.wxs = setup\setup.wxs
Expand Down
14 changes: 0 additions & 14 deletions InstallationValidator.v3.ncrunchsolution

This file was deleted.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
Installation Validation Tool for the Open Systems Pharmacology Suite.

## Code Status
[![Build status](https://ci.appveyor.com/api/projects/status/hffh219angc4svdh/branch/develop?svg=true)](https://ci.appveyor.com/project/open-systems-pharmacology-ci/installationvalidator/branch/develop)
[![Build status](https://img.shields.io/github/actions/workflow/status/Open-Systems-Pharmacology/InstallationValidator/build-and-test.yml?logo=nuget&label=Build%20status)](https://github.com/Open-Systems-Pharmacology/InstallationValidator/actions/workflows/build-and-test.yml)

## Wix Install
https://github.com/wixtoolset/wix3/releases

## Building WIX output for setup
The following command should be run to create the `BatchFiles.wxs`
Expand All @@ -26,4 +29,5 @@ Everyone interacting in the Open Systems Pharmacology community (codebases, issu
We encourage contribution to the Open Systems Pharmacology community. Before getting started please read the [contribution guidelines](https://github.com/Open-Systems-Pharmacology/Suite/blob/master/CONTRIBUTING.md). If you are contributing code, please be familiar with the [coding standards](https://github.com/Open-Systems-Pharmacology/Suite/blob/master/CODING_STANDARDS.md).

## License
InstallationValidator is released under the [GPLv2 License](LICENSE).
InstallationValidator is released under the [GPLv2 License](https://github.com/Open-Systems-Pharmacology/Suite/blob/master/LICENSE).

48 changes: 0 additions & 48 deletions appveyor-nightly.yml

This file was deleted.

49 changes: 0 additions & 49 deletions appveyor.yml

This file was deleted.

Loading
Loading