-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (99 loc) · 3.58 KB
/
python-tests.yml
File metadata and controls
116 lines (99 loc) · 3.58 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
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
108
109
110
111
112
113
114
115
116
name: "python tests and coverage"
on:
pull_request:
branches:
- "main"
push:
branches:
- "main"
jobs:
settings:
runs-on: "ubuntu-latest"
name: "Define workflow settings"
outputs:
default-python-version: "3.12"
gha-setup-python: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
gha-checkout: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"
gha-download-artifact: "actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16"
gha-upload-artifact: "actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b"
# run-tests-and-coverage:
# name: "Run pytest with coverage."
# needs: ["settings"]
# runs-on: "${{ matrix.os }}"
# strategy:
# fail-fast: false
# matrix:
# os:
# - "macos-latest"
# - "windows-latest"
# - "ubuntu-latest"
# python-version:
# - "3.9"
# - "3.10"
# - "3.11"
# - "3.12"
# - "3.13"
# - "3.14"
# steps:
# - name: "Repo checkout"
# uses: "${{ needs.settings.outputs.gha-checkout }}"
# - name: "Set up Python ${{ matrix.python-version }}"
# uses: "${{ needs.settings.outputs.gha-setup-python }}"
# with:
# python-version: "${{ matrix.python-version }}"
# allow-prereleases: true
# - name: "Install nox"
# run: |
# python -m pip install --upgrade nox
# - name: "Run tests and coverage via nox"
# run: |
# nox --session test -- partial-coverage
# - name: "Save coverage artifact"
# uses: "${{ needs.settings.outputs.gha-upload-artifact }}"
# with:
# name: "coverage-artifact-${{ matrix.os}}-${{ matrix.python-version}}"
# path: ".coverage.*"
# retention-days: 1
# include-hidden-files: true
# coverage-compile:
# name: "Compile coverage reports."
# needs: ["settings", "run-tests-and-coverage"]
# runs-on: "ubuntu-latest"
# steps:
# - name: "Repo checkout"
# uses: "${{ needs.settings.outputs.gha-checkout }}"
# - name: "Set up Python"
# uses: "${{ needs.settings.outputs.gha-setup-python }}"
# with:
# python-version: "${{ needs.settings.outputs.default-python-version }}"
# - name: "Install nox"
# run: |
# python -m pip install --upgrade nox
# - name: "Download coverage artifacts"
# uses: "${{ needs.settings.outputs.gha-download-artifact }}"
# with:
# pattern: "coverage-artifact-*"
# merge-multiple: true
# - name: "Compile coverage data, print report"
# run: |
# nox --session coverage_combine
# export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
# echo "TOTAL=$TOTAL" >> $GITHUB_ENV
# echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
# linting:
# name: "Check linting and formatting requirements"
# needs: ["settings"]
# runs-on: "ubuntu-latest"
# steps:
# - name: "Repo checkout"
# uses: "${{ needs.settings.outputs.gha-checkout }}"
# - name: "Set up Python"
# uses: "${{ needs.settings.outputs.gha-setup-python }}"
# with:
# python-version: "${{ needs.settings.outputs.default-python-version }}"
# - name: "Install nox"
# run: |
# python -m pip install --upgrade nox
# - name: "Run formatters and linters"
# run: |
# nox --session lint