-
Notifications
You must be signed in to change notification settings - Fork 32
67 lines (56 loc) · 1.89 KB
/
build-test.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
name: Test
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.name }}-py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [ubuntu, windows, macos]
python-version: ["3.9", "3.10", "3.11"]
include:
- name: ubuntu
os: ubuntu-latest
- name: windows
os: windows-latest
- name: macos
os: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
python -m pip install --upgrade pip
pip install .[tests]
- name: Install (macOS / Windows)
if: runner.os == 'macOS' || runner.os == 'Windows'
run: |
python -m pip install --upgrade pip
pip install pytest
pip install numpy # cftime requires numpy already during setup
pip install .
- name: Lint with flake8 (Linux)
if: runner.os == 'Linux' && matrix.python-version == '3.8'
continue-on-error: true
run: |
pip install flake8
flake8 . --statistics || echo "::error::Check flake8 output for errors"
- name: Testfiles Setup
run: |
git clone --depth=1 https://github.com/atmtools/typhon-testfiles.git
- name: Test (Linux / macOS)
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
export TYPHONTESTFILES=$PWD/typhon-testfiles
pytest --pyargs typhon
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
$Env:HDF5_DISABLE_VERSION_CHECK = 1
$Env:TYPHONTESTFILES = Join-Path $pwd "typhon-testfiles"
pytest --pyargs typhon