-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 2.9 KB
/
pytest.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
# Test reprox on each PR.
name: Test package
# Trigger this code when a new release is published
on:
workflow_dispatch:
release:
types: [ created ]
pull_request:
push:
branches:
- master
jobs:
update:
name: "${{ matrix.test }}_py${{ matrix.python-version }}_sx_${{ matrix.straxen_version }}"
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
python-version: [3.8, 3.9, "3.10"]
test: [ 'coveralls']
straxen_version: ["v1.0.0", "v1.1.0", "v1.1.1", "v1.1.2", "v1.1.3", "v1.2.0", "v1.2.1", "v1.2.2", "v1.2.3", "v1.2.4", "v1.2.5", "v1.2.6", "v1.2.7", "v1.2.8", "v1.3.0", "v1.4.0", "v1.5.0", "v1.6.0", "latest"]
# Only run coverage on py3.8
exclude:
- python-version: "3.10"
test: coveralls
- python-version: 3.9
test: coveralls
env:
REPROX_CONFIG: /home/runner/work/reprox/reprox/test_folder/test.ini
steps:
# Setup and installation
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repo
uses: actions/checkout@v3
- name: Install requirements
run: |
pip install -r extra_requirements/requirements-tests.txt
python setup.py develop
- name: setup test config
run: |
bash .github/scripts/overwrite_testing_file.sh test_folder test.ini
# Secrets and required files
- name: patch utilix file
# Patch this file if we want to have access to the database
run: bash .github/scripts/create_readonly_utilix_config.sh
env:
# RunDB
RUNDB_API_URL: ${{ secrets.RUNDB_API_URL }}
RUNDB_API_USER_READONLY: ${{ secrets.RUNDB_API_USER_READONLY }}
RUNDB_API_PASSWORD_READONLY: ${{ secrets.RUNDB_API_PASSWORD_READONLY}}
PYMONGO_URL: ${{ secrets.PYMONGO_URL }}
PYMONGO_USER: ${{ secrets.PYMONGO_USER }}
PYMONGO_PASSWORD: ${{ secrets.PYMONGO_PASSWORD }}
PYMONGO_DATABASE: ${{ secrets.PYMONGO_DATABASE }}
# Run tests
- name: Test package
# This is running a normal test
if: matrix.test == 'pytest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coverage run --source=reprox,bin -m pytest -v --log-level=DEBUG --durations 0
coveralls --service=github
- name: Coveralls
# Make the coverage report and upload
env:
NUMBA_DISABLE_JIT: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.test == 'coveralls'
run: |
coverage run --source=reprox,bin setup.py test -v
coveralls --service=github
echo ${{ matrix.straxen_version }}
bash .github/scripts/test_old_version.sh ${{ matrix.straxen_version }}
# Done
- name: goodbye
run: echo "tests done, bye bye"