-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (73 loc) · 2.15 KB
/
test-pr.yml
File metadata and controls
77 lines (73 loc) · 2.15 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
name: 'Run Tests'
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
template-generation:
name: 'Generate Template'
runs-on: ubuntu-latest
steps:
- name: 'Check out code'
uses: actions/checkout@v3
- name: 'Install Python'
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 'Install uv'
uses: astral-sh/setup-uv@v5
- name: 'Install cookiecutter'
run: pip install cookiecutter
- name: 'Generate template'
run: cookiecutter --no-input . project_name='Test Project'
- name: 'Generate lock file'
run: uv --project ./test-project lock
- name: 'Cache generated project'
uses: actions/cache@v4
with:
path: ./test-project
key: test-project-${{ github.run_id }}
template-tests:
name: 'Test Template'
needs: template-generation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: 'Install Python'
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 'Install uv'
uses: astral-sh/setup-uv@v5
- name: 'Restore generated project'
uses: actions/cache@v4
with:
path: ./test-project
key: test-project-${{ github.run_id }}
- name: 'Run tests'
run: make -C test-project all
- name: 'Run pyupgrade'
run: make -C test-project pyupgrade
nix-build:
name: 'Build with Nix'
needs: template-generation
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-11]
steps:
- name: 'Install Nix/Cachix'
uses: cachix/install-nix-action@v19
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
- name: 'Restore generated project'
uses: actions/cache@v3
with:
path: ./test-project
key: test-project-${{ github.run_id }}
- name: 'Build with Nix'
run: nix build ./test-project