-
Notifications
You must be signed in to change notification settings - Fork 4
82 lines (70 loc) · 2.24 KB
/
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
77
78
79
80
81
82
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: tests
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches: [ 'main' ]
pull_request:
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install mypy
run: |
python -m pip install mypy numpy
mypy pymsis
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, ubuntu-latest, macos-latest, macos-14]
python-version: ['3.10', '3.11', '3.12']
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
# sets up the compiler paths automatically for us
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 13
- name: Compiler versions
run: |
which gcc
gcc --version
which gfortran
gfortran --version
# On Windows, the compilers can cause issues when
# using higher optimization levels
- name: Add Windows environment settings
if: startsWith(matrix.os, 'windows')
run: |
echo "FFLAGS=-O1" >> $GITHUB_ENV
# Windows can't decode the README which has utf8 characters
echo "PYTHONUTF8=1" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download source files
run: |
python .github/workflows/download_mirror.py
- name: Install pymsis
run: |
python -m pip install --upgrade pip
pip install -v .[tests]
- name: Test with pytest
run: |
# TODO: Get coverage for other modules without specifying pymsis.msis directly
pytest --color=yes --cov=pymsis.msis --cov pymsis.utils --cov-report=xml --pyargs pymsis
- name: Upload code coverage
uses: codecov/codecov-action@v3