-
Notifications
You must be signed in to change notification settings - Fork 17
112 lines (95 loc) · 2.62 KB
/
Copy pathci.yml
File metadata and controls
112 lines (95 loc) · 2.62 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
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
UV_VERSION: 0.11.11
jobs:
commitlint:
name: Commit Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
tests:
name: Run Tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
python-version: ${{ matrix.python-version }}
- name: Run quality checks
run: make quality
- name: Validate package build
run: uv build
release:
name: Build and publish package
needs: tests
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
- name: Build packages
run: uv build
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION=$(uv version --short)
uv run scriv print --version $VERSION --output release-body
gh release create "v${VERSION}" \
--title ${VERSION} \
--target "${{ github.sha }}" \
--notes-file release-body \
dist/*
- name: Publish to PyPI
run: |
uv publish \
--trusted-publishing always \
dist/*
image_build:
runs-on: ubuntu-latest
name: Build the docker images
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
version: ${{ env.UV_VERSION }}
- name: Set up docker buildx
uses: docker/setup-buildx-action@v4
- name: Build codejail image
env:
TUTOR_ROOT: /tmp/tutor-root
run: |
uv run tutor plugins disable mfe indigo
uv run tutor plugins enable codejail
uv run tutor config save
uv run tutor images build codejail \
-d "--cache-from=type=gha" \
-d "--cache-to=type=gha,mode=max"