-
Notifications
You must be signed in to change notification settings - Fork 53
68 lines (59 loc) 路 1.87 KB
/
Copy pathtest.yml
File metadata and controls
68 lines (59 loc) 路 1.87 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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
project-type: ["app", "package"]
typing: ["optional", "strict"]
name: "Python ${{ matrix.python-version }} ${{ matrix.project-type }} with ${{ matrix.typing }} typing"
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: substrate
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "**/uv.lock"
- name: Scaffold Python project
run: |
uvx copier copy --vcs-ref=HEAD substrate my-project \
--defaults \
--data project_type="${{ matrix.project-type }}" \
--data project_name="My Project" \
--data project_description="A Python ${{ matrix.project-type }} that reticulates splines." \
--data project_url="https://github.com/user/repo" \
--data author_name="John Smith" \
--data author_email="john@example.com" \
--data python_version="3.10" \
--data typing="${{ matrix.typing }}" \
--data with_fastapi_api=true \
--data with_typer_cli=true
cd my-project
git config --global init.defaultBranch main
git init
git checkout -b test
git add .
- name: Lint and test project
uses: devcontainers/ci@v0.3
with:
subFolder: ./my-project/
runCmd: |
uv lock
poe lint
poe test
- name: Build app Docker image
if: ${{ matrix.project-type == 'app' }}
uses: docker/build-push-action@v6
with:
context: ./my-project/
target: app