-
Notifications
You must be signed in to change notification settings - Fork 41
60 lines (52 loc) · 1.76 KB
/
main.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
# GitHub Continuous Integration Configuration
name: CI
# Define conditions for when to run this action
on:
pull_request: # Run on all pull requests
push: # Run on all pushes to master
branches:
- main
- develop
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs. Each job has an id, for
# example, one of our jobs is "lint"
jobs:
test:
name: Tests ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
# Define OS and Python versions to use. 3.x is the latest minor version.
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.x"]
os: [ubuntu-latest]
# Sequence of tasks for this job
steps:
# Check out latest code
# Docs: https://github.com/actions/checkout
- name: Checkout code
uses: actions/checkout@v2
# Set up Python
# Docs: https://github.com/actions/setup-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Install dependencies
# https://github.com/ymyzk/tox-gh-actions#workflow-configuration
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage tox tox-gh-actions
# Run tests
# https://github.com/ymyzk/tox-gh-actions#workflow-configuration
- name: Run tests
run: tox
- name: Combine coverage
run: coverage xml
# Upload coverage report
# https://github.com/codecov/codecov-action
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true