-
Notifications
You must be signed in to change notification settings - Fork 38
91 lines (74 loc) · 2.3 KB
/
integrationtests.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
88
89
90
91
name: Integration tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 2 * * 1' # every Monday at 2:00am
env:
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
max-parallel: 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: ceasiompy
use-mamba: true
- name: Set cache date # With that, cache will be updated every day
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/ceasiompy
key: ubuntu-latest-conda-${{ env.DATE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
id: cache
- name: Update environment
run: mamba env update -n ceasiompy -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install ceasiompy with pip
shell: bash -l {0}
run: pip install -e .
- name: Install PyTornado
shell: bash -l {0}
run: installation/Ubuntu/install_pytornado.sh
- name: Install SUMO
shell: bash -l {0}
run: installation/Ubuntu/install_sumo.sh
- name: Install SU2
shell: bash -l {0}
run: installation/Ubuntu/install_su2.sh
- name: Run integration tests
shell: bash -l {0}
run: |
source ~/.bashrc
pytest -v ./tests --cov=ceasiompy/ --cov-report xml:coverage.xml -m "not gui"
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: integrationtests
fail_ci_if_error: true
verbose: true
- name: Upload logs
uses: actions/upload-artifact@v3
with:
name: integration-test-logs
path: tests/workflow_tests/**/ceasiompy.log
# - name: Setup tmate session to SSH to the remote machine (for debugging)
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 15