-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (72 loc) · 2.2 KB
/
run_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Run Tests
on:
schedule:
- cron: '0 8 * * 1'
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
python-version: '3.6'
- os: macos-latest
python-version: '3.7'
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.9'
- os: macos-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: "3.6"
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} Subtest
steps:
- uses: actions/checkout@v3
- name: Link gfortran
uses: fortran-lang/setup-fortran@v1
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Dependencies
run: |
python -m pip install -e .
python -m pip install coverage
- name: Compile Sambvca21 for Windows
if: runner.os == 'windows'
run: |
gfortran -o sambvca21.exe test/sambvca21.f
- name: Compile Sambvca21 for Unix
if: runner.os != 'windows'
run: |
gfortran -o sambvca21.x test/sambvca21.f
- name: Run Tests
run: |
coverage run --source=. --omit=py2sambvca/__init__.py,setup.py,test/* -m unittest discover
- name: Show Coverage
run: |
coverage report -m
# This allows us to have a branch protection rule for tests and deploys with matrix
#
# taken from https:/orgs/community/discussions/4324#discussioncomment-3477871
ci-report-status:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Successful CI
if: ${{ !(contains(needs.build.result, 'failure')) }}
run: exit 0
- name: Failing CI
if: ${{ contains(needs.build.result, 'failure') }}
run: exit 1