Repository navigation
103 lines (100 loc) · 4.52 KB
/
Copy pathfixtures.yml
File metadata and controls
103 lines (100 loc) · 4.52 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Pinned integration fixtures
on:
workflow_call:
permissions:
contents: read
jobs:
fixtures:
name: Fixtures (${{ matrix.os }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: Linux
runner: ubuntu-latest
- os: Windows
runner: windows-latest
env:
CARGO_PROFILE_DEV_DEBUG: line-tables-only
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
path: broca
- name: Load shared fixture pins
run: |
source broca/scripts/ci-fixture-revisions.conf
echo "SUBC_REV=$SUBC_REV" >> "$GITHUB_ENV"
echo "CLAUSTRUM_REV=$CLAUSTRUM_REV" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable
# The daily compatibility lane still exercises moving sibling tips. Its
# binaries are cached by the resolved SHA, never by a mutable branch name.
- name: Resolve nightly sibling revisions
if: github.event_name == 'schedule'
run: |
set -euo pipefail
subc="$(git ls-remote https://github.com/cortexkit/subconscious.git refs/heads/master)"
vault="$(git ls-remote https://github.com/cortexkit/claustrum.git refs/heads/master)"
subc="${subc%%[[:space:]]*}"
vault="${vault%%[[:space:]]*}"
[[ "$subc" =~ ^[a-f0-9]{40}$ && "$vault" =~ ^[a-f0-9]{40}$ ]]
echo "SUBC_REV=$subc" >> "$GITHUB_ENV"
echo "CLAUSTRUM_REV=$vault" >> "$GITHUB_ENV"
- name: Fingerprint fixture toolchain
id: toolchain
run: echo "rust=$(rustc -V | tr ' ' '-')" >> "$GITHUB_OUTPUT"
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: binaries
with:
path: fixtures
key: fixtures-v2-${{ runner.os }}-${{ runner.arch }}-${{ steps.toolchain.outputs.rust }}-${{ env.SUBC_REV }}-${{ env.CLAUSTRUM_REV }}
- name: Checkout subconscious
if: steps.binaries.outputs.cache-hit != 'true'
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
repository: cortexkit/subconscious
ref: ${{ env.SUBC_REV }}
path: subconscious
- name: Checkout claustrum
if: steps.binaries.outputs.cache-hit != 'true'
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
repository: cortexkit/claustrum
ref: ${{ env.CLAUSTRUM_REV }}
path: claustrum
- name: Build fixtures once
if: steps.binaries.outputs.cache-hit != 'true'
run: |
set -euo pipefail
cargo build --locked --manifest-path subconscious/Cargo.toml -p subc-core --bins
cargo build --locked --manifest-path claustrum/Cargo.toml -p credentials-module --bins
suffix=""
if [[ "$RUNNER_OS" == Windows ]]; then suffix=.exe; fi
mkdir -p fixtures/bin fixtures/claustrum/crates/credentials-module/tests/fixtures
cp "subconscious/target/debug/ck-subc$suffix" "subconscious/target/debug/fake-aft-stub$suffix" "subconscious/target/debug/ck$suffix" fixtures/bin/
cp "claustrum/target/debug/ck-claustrum$suffix" "claustrum/target/debug/ck-auth$suffix" fixtures/bin/
cp claustrum/crates/credentials-module/tests/fixtures/enrollment_wire_contract.json fixtures/claustrum/crates/credentials-module/tests/fixtures/
- name: Verify and package fixtures
run: |
set -euo pipefail
suffix=""
if [[ "$RUNNER_OS" == Windows ]]; then suffix=.exe; fi
for name in ck-subc fake-aft-stub ck ck-claustrum ck-auth; do
test -s "fixtures/bin/$name$suffix"
done
test -s fixtures/claustrum/crates/credentials-module/tests/fixtures/enrollment_wire_contract.json
tar -czf "fixtures-$RUNNER_OS.tar.gz" fixtures
echo "Fixture cache exact hit: ${{ steps.binaries.outputs.cache-hit }}; subc=$SUBC_REV vault=$CLAUSTRUM_REV" >> "$GITHUB_STEP_SUMMARY"
# Tar preserves executable permissions when upload-artifact transports Unix binaries.
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: fixtures-${{ matrix.os }}
path: fixtures-${{ matrix.os }}.tar.gz
retention-days: 3