-
Notifications
You must be signed in to change notification settings - Fork 20
88 lines (88 loc) · 2.97 KB
/
Copy pathtoml_fmt_common_test.yaml
File metadata and controls
88 lines (88 loc) · 2.97 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
name: 🧪 toml-fmt-common
on:
workflow_dispatch:
push:
branches: ["main"]
tags-ignore: ["**"]
pull_request:
schedule:
- cron: "0 8 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
name: 🔍 changes
runs-on: ubuntu-latest
outputs:
run: ${{ github.event_name != 'pull_request' || steps.filter.outputs.run == 'true' }}
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: 🔍 Check for changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
id: filter
with:
filters: |
run:
- 'toml-fmt-common/**'
- '.github/workflows/toml_fmt_common_test.yaml'
test:
name: 🐍 ${{ matrix.env }}
needs: changes
if: needs.changes.outputs.run == 'true'
runs-on: ubuntu-latest
environment: test
strategy:
fail-fast: false
matrix:
env: ["3.15", "3.15t", "3.14", "3.13", "3.12", "3.11", "3.10", type, pkg_meta]
defaults:
run:
working-directory: toml-fmt-common
steps:
- name: 📥 Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: 📦 Setup uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: false
cache-dependency-glob: "pyproject.toml"
- name: 🔧 Install tox
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv
- name: 🐍 Install Python
if: startsWith(matrix.env, '3.') && matrix.env != '3.14'
run: uv python install --python-preference only-managed ${{ matrix.env }}
- name: 🔧 Setup test suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
- name: ✅ Run test suite
run: tox run --skip-pkg-install -e ${{ matrix.env }}
env:
PYTEST_ADDOPTS: "-vv --durations=20"
- name: 📤 Upload coverage
if: startsWith(matrix.env, '3.')
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: toml-fmt-common/.tox/${{ matrix.env }}
flags: python-${{ matrix.env }}
all-pass:
name: ✅ toml-fmt-common
if: always()
needs: [changes, test]
runs-on: ubuntu-latest
steps:
- name: Decide whether all jobs passed or were skipped
run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "Some jobs failed or were canceled"
exit 1
fi
echo "All jobs passed or were skipped"