forked from dfm/corner.py
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 2.32 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:
push:
branches:
- main
tags:
- "*"
pull_request:
workflow_dispatch:
inputs:
prerelease:
description: 'Run a pre-release, testing the build'
required: false
type: boolean
default: false
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
nox-session: ["tests"]
include:
- os: macos-latest
python-version: "3.10"
nox-session: "tests"
- os: ubuntu-latest
python-version: "3.10"
nox-session: "lint"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Configure Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.nox-session }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.nox-session }}-
- name: Cache nox session files
uses: actions/cache@v3
with:
path: .nox
key: ${{ runner.os }}-nox-${{ matrix.nox-session }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-${{ matrix.nox-session }}-
- name: Cache pre-commit environments
if: ${{ matrix.nox-session == 'lint' }}
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
${{ runner.os }}-pre-commit-
- name: Install nox
run: |
python -m pip install -U pip
python -m pip install -U nox
- name: Run tests
run: python -m nox --non-interactive -s ${{ matrix.nox-session }}
release:
if: ${{ inputs.prerelease || startsWith(github.ref, 'refs/tags/') }}
needs: tests
uses: dfm/workflows/.github/workflows/python-release.yml@v0.1.0
with:
wheels: false
enable-windows: false
secrets:
pypi-token: ${{ secrets.pypi_password }}