-
Notifications
You must be signed in to change notification settings - Fork 11
75 lines (70 loc) · 2.49 KB
/
test-codegen.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
65
66
67
68
69
70
71
72
73
74
75
name: rsonpath-test codegen
on:
workflow_call:
outputs:
artifact-name:
description: Name of the produced artifact.
value: rsonpath-test-documents
artifact-path:
description: Path to which the artifact should be extracted.
value: crates/rsonpath-test
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RSONPATH_ENABLE_TEST_CODEGEN: 1
CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG: "true"
permissions:
contents: read
jobs:
# Run the test codegen build step once and save the artifact to be used for all other steps.
# This cuts down on CI time, since otherwise we'd regenerate tests on every step of the feature powerset test run.
test-gen:
name: Generate rsonpath-test cases
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: block
allowed-endpoints: >
github.com:443
azure.archive.ubuntu.com:80
crates.io:443
index.crates.io:443
static.crates.io:443
static.rust-lang.org:443
- name: Install lld
run: sudo apt install lld
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Install Rust toolchain (stable)
uses: dtolnay/rust-toolchain@a54c7afa936fefeb4456b2dd8068152669aa8203 # master
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: Override toolchain
run: rustup override set stable
- name: Cache restore (Cargo)
id: cache-restore-cargo
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: x86_64-unknown-linux-gnu-x86_64-unknown-linux-gnu--cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Build with test codegen
id: build-test-codegen
run: cargo build -p rsonpath-test -vv
- name: Upload generated tests as artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: rsonpath-test-documents
path: |
crates/rsonpath-test/documents
crates/rsonpath-test/tests/generated
retention-days: 1