-
-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (79 loc) · 2.25 KB
/
test.yml
File metadata and controls
90 lines (79 loc) · 2.25 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
name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- uses: actions/setup-node@v4
with:
node-version: latest
- name: Copy Template
run: |
uvx copier copy \
./ \
/tmp/test-copier \
-d project_name=test-copier \
-d python_version=${{ matrix.python-version }} \
-d package_name=test_copier \
-d description="Test Copier" \
-d author_name=test-copier \
-d author_email=test-copier@example.com
- name: Test Package Installation
working-directory: /tmp/test-copier
run: |
uv sync
- name: Test Ruff Format
working-directory: /tmp/test-copier
run: |
uv run ruff format --check --diff .
- name: Test Ruff Lint
working-directory: /tmp/test-copier
run: |
uv run ruff check --output-format=github .
- name: Test pytest
working-directory: /tmp/test-copier
run: |
uv run pytest -vs
- name: Test Docker
working-directory: /tmp/test-copier
run: |
./docker/build.sh
./docker/run.sh
- name: Test Docker Compose
working-directory: /tmp/test-copier
run: |
docker compose build
docker compose up -d
docker compose down
- name: Test devcontainer
working-directory: /tmp/test-copier
run: |
npm install -g @devcontainers/cli
git init
devcontainer build --workspace-folder /tmp/test-copier
devcontainer up --workspace-folder /tmp/test-copier
ci-check:
name: CI Status Check
runs-on: ubuntu-latest
needs: [ci]
if: always()
steps:
- name: Some checks failed
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')}}
run: exit 1
- name: All checks ok
if: ${{ contains(needs.*.result, 'success') }}
run: exit 0