-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (65 loc) · 2.16 KB
/
pr.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
name: Check Pipeline
on:
# manual dispatch
workflow_dispatch:
# run on PRs to master when - is opened,
# new commit is pushed or is set as ready for review
pull_request:
types: [opened, synchronize, ready_for_review]
branches:
- master
jobs:
run_tests:
runs-on: ubuntu-20.04
container:
# use our base container
# note that when a new dependency is added,
# the image must be rebuild and published again
image: ghcr.io/mild-blue/txmatching-conda-dependencies:1.0.29
timeout-minutes: 15
# disable run if the PR is draft (as our CLI creates PR as draft once the issue is in progress)
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
# verify that the conda.yaml (dependencies file) in the repository
# is the same as the one used in the docker image
# if this step fails, update the base docker image and push it
- name: Verify Conda consistency
run: |
diff -f conda.yml /app/conda.yml
# initialize conda binary, conda env must be
# activated in each step again
- name: Setup Conda
# define that we want to use bash
# which is then reused
shell: bash
run: |
conda --version
conda env
conda list
conda init bash
source ~/.bashrc
- name: Verify Conda installation
# use already existing instance of shell
shell: bash -l {0}
run: |
conda activate txmatching
conda list
- name: Run Linter
shell: bash -l {0}
# conda activate txmatching must be called again in order to
# activate it for the step
run: |
conda activate txmatching
pylint txmatching local_testing_utilities
- name: Execute tests
shell: bash -l {0}
env:
ETRL_LOGIN: ${{ secrets.ETRL_LOGIN }}
ETRL_PASSWORD: ${{ secrets.ETRL_PASSWORD }}
run: |
conda activate txmatching
cd tests
export PYTHONPATH=../
export LOGGING_DISABLE_LEVEL_FOR_TESTING=ERROR
python -m unittest discover -s . -t .