|
4 | 4 | push:
|
5 | 5 | branches:
|
6 | 6 | - master
|
7 |
| - |
8 | 7 | pull_request:
|
9 | 8 |
|
10 | 9 | jobs:
|
11 |
| - |
12 |
| - # Build and run unit tests |
13 |
| - test: |
| 10 | + # Build and Integration Test |
| 11 | + build_integration_test: |
14 | 12 | strategy:
|
15 | 13 | fail-fast: false
|
16 | 14 | matrix:
|
17 |
| - OS: |
| 15 | + OS: |
18 | 16 | - macos-latest
|
19 | 17 | - ubuntu-latest
|
20 | 18 | - ubuntu-20.04
|
21 |
| - |
22 | 19 | runs-on: ${{ matrix.OS }}
|
23 | 20 |
|
24 | 21 | steps:
|
25 | 22 | # checkout source code
|
26 | 23 | - uses: actions/checkout@v2
|
27 | 24 |
|
28 |
| - # compile tests |
29 |
| - - name: compile tests |
30 |
| - run: make test |
| 25 | + # install doxygen |
| 26 | + - name: Install Doxygen |
| 27 | + run: | |
| 28 | + if [[ "$RUNNER_OS" == "Linux" ]]; then |
| 29 | + sudo apt-get install doxygen -y |
| 30 | + elif [[ "$RUNNER_OS" == "macOS" ]]; then |
| 31 | + brew install --formula doxygen |
| 32 | + fi |
| 33 | + |
| 34 | + # compile SIPNET |
| 35 | + - name: compile sipnet |
| 36 | + run: make |
31 | 37 |
|
32 |
| - # run tests |
33 |
| - - name: run tests |
34 |
| - run: make testrun |
| 38 | + # remove existing test output file |
| 39 | + - name: Remove Niwout Output File |
| 40 | + run: rm Sites/Niwot/niwot.out |
| 41 | + |
| 42 | + # run single sipnet run |
| 43 | + - name: Run SIPNET on Sites/Niwot/niwot |
| 44 | + run: ./sipnet |
| 45 | + |
| 46 | + # check for correct output of Niwot run |
| 47 | + - name: Check if niwot.out is generated |
| 48 | + if: ${{ !files.exists('Sites/Niwot/niwot.out') }} |
| 49 | + run: | |
| 50 | + echo "::error title={No Output}::Test run for Niwot site failed to produce output" |
| 51 | + exit 1 |
| 52 | + # Check if niwot.out has changed |
| 53 | + - name: Check whether niwot.out has changed |
| 54 | + shell: bash |
| 55 | + run: | |
| 56 | + if git diff --exit-code Sites/Niwot/niwot.out; then |
| 57 | + echo "Success: Niwot.out created and has not changed" |
| 58 | + else |
| 59 | + echo "::error title={Output Changed}::The test file niwot.out has changed. This is expected to fail with some changes to SIPNET. When this happens, assess correctness and then update the reference niwot.out." |
| 60 | + exit 1 |
| 61 | + fi |
35 | 62 |
|
36 |
| - # try to build SIPNET on Ubuntu & MacOS |
37 |
| - build: |
| 63 | + # Run Unit Tests |
| 64 | + test: |
| 65 | + needs: build_integration_test |
38 | 66 | strategy:
|
39 | 67 | fail-fast: false
|
40 | 68 | matrix:
|
41 |
| - OS: |
| 69 | + OS: |
42 | 70 | - macos-latest
|
43 | 71 | - ubuntu-latest
|
44 | 72 | - ubuntu-20.04
|
45 |
| - |
46 | 73 | runs-on: ${{ matrix.OS }}
|
47 | 74 |
|
48 | 75 | steps:
|
49 |
| - # checkout source code |
50 |
| - - uses: actions/checkout@v2 |
51 |
| - |
52 |
| - # install doxygen |
53 |
| - - name: Install Doxygen |
54 |
| - run: | |
55 |
| - if [[ "$RUNNER_OS" == "Linux" ]]; then |
56 |
| - sudo apt-get install doxygen -y |
57 |
| - elif [[ "$RUNNER_OS" == "macOS" ]]; then |
58 |
| - brew install --formula doxygen |
59 |
| - fi |
60 |
| - |
61 |
| - # compile SIPNET |
62 |
| - - name: compile sipnet |
63 |
| - run: make |
| 76 | + # checkout source code |
| 77 | + - uses: actions/checkout@v2 |
64 | 78 |
|
65 |
| - # remove existing test output file |
66 |
| - - name: Remove Niwout Output File |
67 |
| - run: rm Sites/Niwot/niwot.out |
| 79 | + # compile unit tests |
| 80 | + - name: compile tests |
| 81 | + run: make test |
68 | 82 |
|
69 |
| - # run single sipnet run |
70 |
| - - name: sipnet on Sites/Niwot/niwot |
71 |
| - run: ./sipnet |
| 83 | + # run tests |
| 84 | + - name: Run Unit Tests |
| 85 | + run: make testrun |
72 | 86 |
|
73 |
| - # check output of test |
74 |
| - - name: fail if no niwot output exists |
75 |
| - if: ${{ hashFiles('Sites/Niwot/niwot.out') == '' }} |
76 |
| - run: | |
77 |
| - echo "::error title={No Output}::Test run for Niwot site failed to produce output" |
78 |
| - exit 1 |
79 |
| - # check whether niwot.out has changed |
80 |
| - - name: Check whether niwot.out has changed |
81 |
| - shell: bash |
82 |
| - run: | |
83 |
| - if git diff --exit-code Sites/Niwot/niwot.out; then |
84 |
| - echo "Success: Niwot.out created and has not changed" |
85 |
| - else |
86 |
| - echo "::error title={Output Changed}::The test file niwot.out has changed" |
87 |
| - exit 1 |
88 |
| - fi |
0 commit comments