Repository navigation
85 lines (74 loc) · 2.67 KB
/
Copy pathgithub-automation-tests.yml
File metadata and controls
85 lines (74 loc) · 2.67 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
name: GitHub automation tests
on:
pull_request:
paths:
- ".github/actions/**"
- ".github/scripts/**"
- ".github/tests/**"
- ".github/workflows/python-api-compatibility.yml"
- ".github/workflows/python-test-coverage.yml"
- ".github/workflows/github-automation-tests.yml"
- ".github/workflows/devflow-fix-ci.yml"
- ".github/workflows/issue-plan.md"
- ".github/workflows/issue-plan.lock.yml"
- "python/pyproject.toml"
- "python/tooling/requirements-api-compatibility.txt"
- "python/uv.lock"
push:
branches:
- main
paths:
- ".github/actions/**"
- ".github/scripts/**"
- ".github/tests/**"
- ".github/workflows/python-api-compatibility.yml"
- ".github/workflows/python-test-coverage.yml"
- ".github/workflows/github-automation-tests.yml"
- ".github/workflows/devflow-fix-ci.yml"
- ".github/workflows/issue-plan.md"
- ".github/workflows/issue-plan.lock.yml"
- "python/pyproject.toml"
- "python/tooling/requirements-api-compatibility.txt"
- "python/uv.lock"
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "22"
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
version-file: "python/pyproject.toml"
- name: Run JavaScript tests
run: node --test .github/tests/*.js
- name: Run Python tests
run: python .github/tests/test_python_check_coverage.py
- name: Run Python API compatibility tests
working-directory: ${{ runner.temp }}
env:
UV_NO_CONFIG: "1"
run: |
griffe_requirement="$(
python3 - "$GITHUB_WORKSPACE/python/tooling/requirements-api-compatibility.txt" <<'PY'
import sys
requirements = [
line.strip()
for line in open(sys.argv[1], encoding="utf-8")
if line.strip() and not line.lstrip().startswith("#")
]
if len(requirements) != 1:
raise SystemExit("Expected exactly one Griffe tool requirement")
print(requirements[0])
PY
)"
uv --no-config run \
--no-project \
--with "$griffe_requirement" \
python "$GITHUB_WORKSPACE/.github/tests/test_python_api_compatibility.py"