-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (64 loc) · 1.96 KB
/
auto-publish.yml
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
name: CI
on:
pull_request: {}
push:
branches: [main]
jobs:
main:
name: Build, Validate and Deploy
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: w3c/spec-prod@v2
with:
GH_PAGES_BRANCH: gh-pages
# equivalent to the Bikeshed CLI argument, `--die-on=link-error`
BUILD_FAIL_ON: link-error
check-cddl-consistency:
name: Verify that the generated CDDL files are in sync with the inline CDDL
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Extract CDDL
run: npm run extract-schemas
- name: Verify that the generated files match the in-line CDDL
run: git diff --exit-code
check-cddl-validity:
name: Verify that the generated CDDL files are valid
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get cddl version
run: curl -s https://crates.io/api/v1/crates/cddl | python3 -c "import sys, json; print(json.load(sys.stdin)['crate']['max_stable_version'])" | tee cddl.txt
- name: "Cache rust binaries"
uses: actions/cache@v3
id: cache-cddl
env:
cache-name: cache-cddl
with:
path: |
~/.cargo/bin/
~/.cargo/git/db/
~/.cargo/registry/cache/
~/.cargo/registry/index/
./target/
key: cddl-${{ hashFiles('cddl.txt') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Validate CDDL files
run: ./scripts/test-cddl.sh
check-json-schema-validity:
name: Verify that the JSON schema files are valid
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- name: Validate JSON Schema files
run: ./scripts/validate-json-schema.js