Repository navigation
51 lines (46 loc) · 2.17 KB
/
Copy pathtest-linear-ticket.yml
File metadata and controls
51 lines (46 loc) · 2.17 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
# CONTRACT: this is one of THIS repo's own path-filtered script tests, NOT a reusable
# workflow. It is not callable and has no caller pattern:
# TRIGGERS — `pull_request` and `push` to main, both filtered to scripts/linear-ticket/**
# and this file. A change elsewhere in the repo does not run it.
# INPUTS — none. SECRETS — none. Read-only `contents: read`; the suite is hermetic and
# makes no network call.
# The reusable workflow these scripts back is .github/workflows/linear-ticket.yml.
name: Test linear-ticket scripts
# Runs the hermetic lib.py unittest suite for the linear-ticket gate. The gate decides
# whether every consuming repo's PRs can merge, so a regression in the policy filter,
# candidate extraction, or error classification silently passes or blocks PRs — cheap to
# guard with a unit run on change. The real-Linear behaviours (URL canonicalization,
# attachment timing) are proven in the pilot, not here.
on:
pull_request:
paths:
- 'scripts/linear-ticket/**'
- '.github/workflows/test-linear-ticket.yml'
# linear-ticket.yml passes the scripts their whole input contract through env, so a
# change to it can break the suite without touching a file under scripts/linear-ticket/.
- '.github/workflows/linear-ticket.yml'
push:
branches: [main]
paths:
- 'scripts/linear-ticket/**'
- '.github/workflows/test-linear-ticket.yml'
- '.github/workflows/linear-ticket.yml'
permissions:
contents: read
jobs:
test:
name: unittest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.12'
- name: Compile the validator (syntax gate for validate.py, which the suite does not import)
run: python3 -m py_compile scripts/linear-ticket/lib.py scripts/linear-ticket/validate.py
- name: lib suite
run: python3 -m unittest discover -s scripts/linear-ticket/tests -p 'test_*.py' -v