forked from ansatzcapital/dilib
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 2.02 KB
/
test.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
name: Test
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '0 5 * * *'
permissions:
contents: read
jobs:
# Run tests, linters, and checkers via nox
test:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
# See https://help.github.com/articles/virtual-environments-for-github-actions
platform:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8']
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip wheel
python -m pip install nox
- name: Test with nox
run: nox
# Test building and publishing
# See:
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
# - https://packaging.python.org/en/latest/tutorials/packaging-projects/
# - https://www.seanh.cc/2022/05/21/publishing-python-packages-from-github-actions/
publish-test:
runs-on: ubuntu-latest
needs: [test]
strategy:
matrix:
python-version: ['3.8']
steps:
- uses: actions/checkout@v3
with:
# See https://github.com/actions/checkout/issues/261
ref: ${{ github.event.pull_request.head.sha }}
# Grab entire history for setuptools_scm
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade build twine
- name: Create packages
run: python -m build
- name: Run twine check
run: twine check dist/*