-
Notifications
You must be signed in to change notification settings - Fork 52
114 lines (97 loc) · 3.25 KB
/
Copy pathtesting.yml
File metadata and controls
114 lines (97 loc) · 3.25 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Test AMRClaw
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
permissions:
contents: read
env:
CLAW: ${{ github.workspace }}
jobs:
python-lint:
name: >
python-lint - ubuntu-latest - py ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Checkout AMRClaw branch
uses: actions/checkout@v6.0.2
- name: Lint with flake8
run: |
cd ${CLAW}
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude dev
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
regression-tests:
name: >
regression - ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} ${{ matrix.build }} - py ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
build: [debug, opt]
python-version: ['3.12']
toolchain:
- {compiler: gcc, version: 14}
- {compiler: gcc, version: 15}
exclude:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 15}
- os: macos-latest
toolchain: {compiler: gcc, version: 14}
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Set up compilers
uses: fortran-lang/setup-fortran@v1.9.0
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 meson-python ninja pytest numpy
- name: Checkout Clawpack
uses: actions/checkout@v6.0.2
with:
repository: clawpack/clawpack
submodules: true
- name: Checkout AMRClaw branch
uses: actions/checkout@v6.0.2
with:
path: amrclaw
- name: Install clawpack python
run: |
pip install --no-build-isolation --editable .
- name: Run regression tests
run: |
cd ${CLAW}/amrclaw
source .github/scripts/set_test_env.sh regression "${{ matrix.toolchain.compiler }}" "${{ matrix.build }}"
echo "FFLAGS: $FFLAGS"
echo "OMP_NUM_THREADS: $OMP_NUM_THREADS"
pytest --basetemp=${CLAW}/amrclaw/pytest_tmp -vv -s -o addopts=""
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v7
with:
name: test_results_${{ matrix.os }}_${{ matrix.toolchain.compiler }}_${{ matrix.build }}
path: ${{ env.CLAW }}/amrclaw/pytest_tmp
if-no-files-found: ignore