-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (92 loc) · 2.7 KB
/
Copy pathci.yml
File metadata and controls
100 lines (92 loc) · 2.7 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
name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Default-deny: every job is read-only unless it declares more.
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install -e ".[dev]"
- run: ruff check .
- run: mypy loopforge
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install -e ".[dev]"
- run: python -m pytest -q
self-lint:
# Dogfood: loopforge lints its own example loop and must find it complete.
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -e .
- run: loopforge lint examples/ci-green --fail-at major
- run: loopforge lint examples/ci-green --score
action-smoke:
# Run the published composite action end-to-end (uses: ./) so the wrapper is proven on every
# commit — install path, arg handling, and exit codes, not just static YAML.
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Action passes on a complete loop
uses: ./
with:
path: examples/ci-green
fail-at: major
- name: Action fails on a half-baked loop
id: gate
uses: ./
continue-on-error: true
with:
path: examples/half-baked
fail-at: major
- name: Assert the gate actually failed
run: |
if [ "${{ steps.gate.outcome }}" != "failure" ]; then
echo "::error::action did not fail on the half-baked loop — fail-at gate is broken"
exit 1
fi
echo "fail-at gate works: the half-baked loop correctly failed the action."
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install build twine
- run: python -m build --sdist --wheel
- run: python -m twine check dist/*