-
-
Notifications
You must be signed in to change notification settings - Fork 8
107 lines (93 loc) · 2.78 KB
/
ci.yaml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: CI
on:
push:
branches:
- main
pull_request:
permissions:
pull-requests: write
jobs:
# Build the docs and update the PR description w/ a link to readthedocs
# https://github.com/readthedocs/actions/tree/main/preview
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "ridgeplot"
# Run static checks only for Ubuntu and Python 3.8
static-checks:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
with:
python-version: "3.8"
requirements: tox
# Instead of running all checks in one task (i.e., `tox -m static`),
# we'll instead run them one-by-one, so that it's easier to
# identify and debug failing tests in the GitHub UI.
- name: Run static checks with pre-commit
shell: bash
run: tox -e pre-commit
- name: Run type checks with mypy
shell: bash
run: tox -e mypy
# Run test suits for all platforms and Python versions
software-tests:
name: Software tests
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
# - "3.12"
os:
- ubuntu-latest
- macos-latest
# - windows-latest
fail-fast: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python
with:
python-version: "${{ matrix.python-version }}"
requirements: tox
# Instead of running all tests in one task (i.e., `tox -m tests`),
# we'll instead run them one-by-one, so that it's easier to
# identify and debug failing tests in the GitHub UI.
- name: Run unit tests
shell: bash
run: tox -e tests-unit
env:
DIFF_AGAINST: HEAD
- name: Run doctests
shell: bash
run: tox -e doctests
- name: Run E2E tests
shell: bash
run: tox -e tests-e2e
- name: Test the `extras` utilities
shell: bash
run: tox -e tests-extras
# Upload coverage reports to Codecov and Codacy.
- name: Upload coverage to codecov
uses: codecov/codecov-action@v3
env:
OS: "${{ matrix.os }}"
PYTHON: "${{ matrix.python-version }}"
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
- name: Upload coverage to codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml