-
Notifications
You must be signed in to change notification settings - Fork 7
87 lines (71 loc) · 2.38 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
83
84
85
86
87
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
strategy:
max-parallel: 5
matrix:
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/airtrafficsim
# - os: macos-latest
# label: osx-64
# prefix: /Users/runner/miniconda3/envs/airtrafficsim
# - os: windows-latest
# label: win-64
# prefix: C:\Miniconda3\envs\airtrafficsim
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: airtrafficsim
channel-priority: strict
environment-file: environment.yml
python-version: 3.11
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- run: |
conda info
conda list
- name: Download data from private repository
uses: actions/checkout@v3
with:
repository: HKUST-OCTAD-LAB/AirTrafficSim-data
ssh-key: ${{ secrets.SSH_KEY }}
path: AirTrafficSim-data
- name: Unzip data
run: |
unzip AirTrafficSim-data/BADA.zip -d airtrafficsim/data/performance/BADA
mv AirTrafficSim-data/.cdsapirc $HOME/
# - name: Lint with flake8
# run: |
# conda install flake8
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # 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
- name: Test with pytest
run: |
coverage run -m pytest
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3