-
-
Notifications
You must be signed in to change notification settings - Fork 9
82 lines (63 loc) · 1.86 KB
/
tests.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
name: Tests
on:
# On which repository actions to trigger the build.
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allow job to be triggered manually.
workflow_dispatch:
# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
# Run all jobs to completion (false), or cancel
# all jobs once the first one fails (true).
fail-fast: true
# Define a minimal test matrix, it will be
# expanded using subsequent `include` items.
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
bare: [false]
defaults:
run:
shell: bash
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
BARE: ${{ matrix.bare }}
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} ${{ matrix.bare && '(bare)' || '' }}
steps:
- name: Acquire sources
uses: actions/checkout@v3
- name: Install prerequisites (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
- name: Install project dependencies (Baseline)
run: |
pip install -r requirements.txt -r dev-requirements.txt
# For saving resources, code style checking is
# only invoked within the `bare` environment.
- name: Check code style
if: matrix.bare == true
run: |
flake8 ultrasync --count --show-source --statistics
- name: Run tests
run: |
coverage run -m pytest
- name: Process coverage data
run: |
coverage xml
coverage report
- name: Upload coverage data
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}