-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (56 loc) · 1.52 KB
/
ci.yml
File metadata and controls
60 lines (56 loc) · 1.52 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
name: CI
on:
push:
branches:
- main
pull_request:
env:
JUPYTER_PLATFORM_DIRS: '1'
jobs:
get-environments:
runs-on: ubuntu-latest
outputs:
envs: ${{ steps.get-envs.outputs.envs }}
steps:
- uses: actions/checkout@v6
with: { filter: blob:none, fetch-depth: 0 }
- uses: astral-sh/setup-uv@v7
with: { enable-cache: false }
- id: get-envs
run: |
ENVS_JSON=$(NO_COLOR=1 uvx hatch env show --json | jq -c 'to_entries
| map(
select(.key | startswith("hatch-test"))
| { name: .key, python: .value.python }
)')
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
test:
needs: [get-environments]
runs-on: ubuntu-latest
strategy:
matrix:
env: ${{ fromJSON(needs.get-environments.outputs.envs) }}
steps:
- uses: actions/checkout@v6
with: { filter: blob:none, fetch-depth: 0 }
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.env.python-version }}
- uses: astral-sh/setup-uv@v7
with: { enable-cache: true }
- run: uvx hatch env create ${{ matrix.env.name }}
- uses: pavelzw/pytest-action@v2
with:
custom-pytest: uvx hatch run ${{ matrix.env.name }}:run --color=yes
click-to-expand: false
verbose: true
job-summary: true
emoji: false
check:
if: always()
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}