-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (49 loc) · 1.95 KB
/
pr_workflow.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
name: mvesuvio pull request workflow
on: push
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Set up conda environnment
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
miniforge-variant: Mambaforge
activate-environment: vesuvio-env
environment-file: environment.yml
auto-activate-base: false
- name: Flake8
run: python -m flake8 --config=config.flake8
- name: Install Git
run: mamba install -y git
- name: Install mvesuvio package
run: pip install .
- name: Check for analysis files changed
run: |
echo "analysis-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^src/' -e '^tests/' && echo true || echo false)" >> $GITHUB_ENV
- name: Check for calibration files changed
run: |
echo "calibration-changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q -e '^tools/calibration_scripts/' -e '^tests/' && echo true || echo false)" >> $GITHUB_ENV
- name: Run mvesuvio Analysis Unit Tests
if: ${{ env.analysis-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/unit/analysis
- name: Run mvesuvio Analysis System Tests
if: ${{ env.analysis-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/system/analysis
- name: Run mvesuvio Calibration Unit Tests
if: ${{ env.calibration-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/unit/calibration
- name: Run Vesuvio Calibration System Tests
if: ${{ env.calibration-changed == 'true'}}
run: |
python -m unittest discover -s ./tests/system/calibration