-
Notifications
You must be signed in to change notification settings - Fork 32
80 lines (66 loc) · 2.25 KB
/
test.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
name: Run Test Suite
on: [push, pull_request]
env:
SAS_BASE_DIR: sas
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
group: [1, 2, 3, 4, 5]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: '**/setup.cfg'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --require-hashes --no-deps -r requirements_dev.txt
pip install .
- name: Lint with flake8
run: |
pip 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: Cache Files
id: cache-sas
uses: actions/cache@v3
with:
path: ${{ env.SAS_BASE_DIR }}
key: ${{ runner.os }}-sas-${{ hashFiles('sas/**') }}
restore-keys: |
${{ runner.os }}-sas-
- name: Download and Check Data
if: steps.cache-sas.outputs.cache-hit != 'true'
run: |
mkdir ${{ env.SAS_BASE_DIR }}
python bin/get_test_data.py
ls ${{ env.SAS_BASE_DIR }}/*
find ${{ env.SAS_BASE_DIR }} -name '*'
find ${{ env.SAS_BASE_DIR }} -name '*' | wc -l
du -sh ${{ env.SAS_BASE_DIR }}
- name: Setup SDSS-IV data netrc
uses: extractions/netrc@v1
with:
machine: data.sdss.org
username: ${{ secrets.S4_USERNAME }}
password: ${{ secrets.S4_PASSWORD }}
- name: Setup SDSS-IV api netrc
uses: extractions/netrc@v1
with:
machine: api.sdss.org
username: ${{ secrets.S4_USERNAME }}
password: ${{ secrets.S4_PASSWORD }}
- name: Run tests
run: |
pytest tests --splits 5 --group ${{ matrix.group }} --durations-path tests/.test_durations --local-only -m "not uses_web and not uses_db and not slow"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml