-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 2.53 KB
/
ci.yml
File metadata and controls
83 lines (80 loc) · 2.53 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
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint
run: ruff check .
- name: Unit tests
run: pytest -q -m "not integration"
relevance-summary:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Start SolrCloud
run: make dev-up
- name: Wait for Solr and setup baseline
run: |
for i in $(seq 1 30); do
if curl -fsS "http://localhost:8983/solr/admin/info/system?wt=json" >/dev/null; then
break
fi
sleep 2
done
make demo-setup
- name: Run schema-lens scenario
run: |
schema-lens run examples/changesets/prod_realism_example.yaml --out out/ci
- name: Gate
run: |
schema-lens gate --compare out/ci/compare.json --policy examples/policy/gate_default.yaml || test $? -eq 2
- name: Build CI summary
run: |
schema-lens ci summarize --compare out/ci/compare.json --policy examples/policy/gate_default.yaml --out out/ci/summary.md
cat out/ci/summary.md
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: schema-lens-ci-artifacts
path: out/ci
if-no-files-found: warn
- name: Post PR comment
if: always() && github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const body = fs.existsSync('out/ci/summary.md')
? fs.readFileSync('out/ci/summary.md', 'utf8')
: 'Schema-Lens summary missing.';
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
- name: Teardown SolrCloud
if: always()
run: make dev-down