Repository navigation
66 lines (61 loc) · 1.85 KB
/
Copy pathpython-tests.yml
File metadata and controls
66 lines (61 loc) · 1.85 KB
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
name: Run unit tests
on:
pull_request:
push:
branches:
- master
tags:
workflow_dispatch:
schedule:
# Run every Sunday at 03:53 UTC
- cron: 13 3 * * 0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
tests:
name: ${{ matrix.python-version }} ${{ matrix.nox_session }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: '3.11'
nox_session: tests
- python-version: '3.12'
nox_session: tests
- python-version: '3.13'
nox_session: tests
nox_args: '--remote-data=any'
- python-version: '3.14'
nox_session: coverage
- python-version: '3.15'
nox_session: tests
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install packages
run: |
sudo apt update
sudo apt-get install libcfitsio-dev source-extractor
- name: Install Nox
run: python -m pip install nox coverage
- name: Run tests
run: nox -s ${{ matrix.nox_session }} -- ${{ matrix.nox_args }}
- name: Convert coverage
if: ${{ contains(matrix.nox_session, 'coverage') }}
run: python -m coverage xml
- name: Upload coverage to Codecov
if: ${{ contains(matrix.nox_session, 'coverage') }}
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}