Update HCR fixture for watch rebuilds #399
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Cross-Repo Integration Tests | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/db-backend/**' | |
| - '.github/rr-backend-pin.txt' | |
| - '.github/sibling-pins' | |
| - 'scripts/run-cross-repo-tests.sh' | |
| - '.github/workflows/cross-repo-tests.yml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/db-backend/**' | |
| - '.github/rr-backend-pin.txt' | |
| - '.github/sibling-pins' | |
| - 'scripts/run-cross-repo-tests.sh' | |
| - '.github/workflows/cross-repo-tests.yml' | |
| workflow_dispatch: | |
| inputs: | |
| rr_backend_ref: | |
| description: 'rr-backend git ref to test against (default: from pin file)' | |
| required: false | |
| default: '' | |
| shell_recorders_ref: | |
| description: 'shell-recorders git ref to test against (default: from sibling-pins)' | |
| required: false | |
| default: '' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| rr-backend-tests: | |
| runs-on: [self-hosted, nixos] | |
| steps: | |
| - name: Checkout codetracer | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Install Nix | |
| uses: ./.github/actions/setup-nix | |
| with: | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| cachix-cache: ${{ vars.CACHIX_CACHE }} | |
| trusted-public-keys: ${{ vars.TRUSTED_PUBLIC_KEYS }} | |
| substituters: ${{ vars.SUBSTITUTERS }} | |
| gh-token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Resolve rr-backend ref | |
| id: resolve-ref | |
| run: | | |
| if [[ -n "${{ github.event.inputs.rr_backend_ref }}" ]]; then | |
| REF="${{ github.event.inputs.rr_backend_ref }}" | |
| elif [[ -f .github/sibling-pins ]]; then | |
| PIN=$(grep -E '^codetracer-(native-backend|rr-backend) ' .github/sibling-pins | head -1 | cut -d' ' -f2) || true | |
| if [[ -n "${PIN:-}" ]]; then | |
| REF="$PIN" | |
| fi | |
| fi | |
| if [[ -z "${REF:-}" ]] && [[ -f .github/rr-backend-pin.txt ]]; then | |
| REF="$(head -1 .github/rr-backend-pin.txt | tr -d '[:space:]')" | |
| fi | |
| REF="${REF:-main}" | |
| echo "ref=$REF" >> "$GITHUB_OUTPUT" | |
| echo "Resolved rr-backend ref: $REF" | |
| - name: Clone native-backend | |
| uses: metacraft-labs/metacraft-github-actions/clone-repo@main | |
| with: | |
| repo: metacraft-labs/codetracer-native-backend | |
| ref: ${{ steps.resolve-ref.outputs.ref }} | |
| path: ${{ github.workspace }}/../codetracer-native-backend | |
| gh-token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Build ct-native-replay | |
| run: | | |
| CLONE_DIR="$(pwd)/../codetracer-native-backend" | |
| nix develop "$CLONE_DIR" --command \ | |
| bash -c "cd '$CLONE_DIR' && cargo build" | |
| - name: Resolve rr-backend environment paths | |
| id: rr-libs | |
| run: | | |
| CLONE_DIR="$(pwd)/../codetracer-native-backend" | |
| # Use markers to extract paths cleanly (nix develop may print banners) | |
| RAW="$(nix develop "$CLONE_DIR" --command bash -c \ | |
| 'echo "___LD_PATH_START___"; echo "$LD_LIBRARY_PATH"; echo "___LD_PATH_END___"; | |
| echo "___PATH_START___"; echo "$PATH"; echo "___PATH_END___"')" | |
| RR_LD="$(echo "$RAW" | sed -n '/___LD_PATH_START___/{n;p;}')" | |
| RR_PATH="$(echo "$RAW" | sed -n '/___PATH_START___/{n;p;}')" | |
| echo "ld_library_path=$RR_LD" >> "$GITHUB_OUTPUT" | |
| echo "extra_path=$RR_PATH" >> "$GITHUB_OUTPUT" | |
| echo "Resolved rr-backend LD_LIBRARY_PATH: $RR_LD" | |
| echo "Resolved rr-backend PATH (first 200 chars): ${RR_PATH:0:200}..." | |
| - name: Run cross-repo integration tests | |
| run: | | |
| CT_NATIVE_REPLAY="$(pwd)/../codetracer-native-backend/target/debug/ct-native-replay" | |
| echo "Using ct-native-replay: $CT_NATIVE_REPLAY" | |
| RR_EXTRA_PATH="${{ steps.rr-libs.outputs.extra_path }}" | |
| RR_LD="${{ steps.rr-libs.outputs.ld_library_path }}" | |
| nix develop .#devShells.x86_64-linux.default --command \ | |
| bash -c " | |
| export PATH=\"${RR_EXTRA_PATH}:\$PATH\" | |
| export CT_NATIVE_REPLAY_PATH=\"${CT_NATIVE_REPLAY}\" | |
| export CT_NATIVE_REPLAY_LD_LIBRARY_PATH=\"${RR_LD}\" | |
| export CODETRACER_RR_SOFT_MODE=1 | |
| ./scripts/run-cross-repo-tests.sh --soft all | |
| " | |
| - name: Upload test logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rr-backend-test-logs | |
| path: target/cross-test-logs/ | |
| retention-days: 14 | |
| if-no-files-found: ignore | |
| shell-recorder-tests: | |
| runs-on: [self-hosted, nixos] | |
| steps: | |
| - name: Checkout codetracer | |
| uses: actions/checkout@v5 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Install Nix | |
| uses: ./.github/actions/setup-nix | |
| with: | |
| cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| cachix-cache: ${{ vars.CACHIX_CACHE }} | |
| trusted-public-keys: ${{ vars.TRUSTED_PUBLIC_KEYS }} | |
| substituters: ${{ vars.SUBSTITUTERS }} | |
| gh-token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Resolve shell-recorders ref | |
| id: resolve-ref | |
| run: | | |
| if [[ -n "${{ github.event.inputs.shell_recorders_ref }}" ]]; then | |
| REF="${{ github.event.inputs.shell_recorders_ref }}" | |
| elif [[ -f .github/sibling-pins ]]; then | |
| PIN=$(grep '^codetracer-shell-recorders ' .github/sibling-pins | cut -d' ' -f2) || true | |
| if [[ -n "${PIN:-}" ]]; then | |
| REF="$PIN" | |
| fi | |
| fi | |
| REF="${REF:-main}" | |
| echo "ref=$REF" >> "$GITHUB_OUTPUT" | |
| echo "Resolved shell-recorders ref: $REF" | |
| - name: Clone shell-recorders | |
| uses: metacraft-labs/metacraft-github-actions/clone-repo@main | |
| with: | |
| repo: metacraft-labs/codetracer-shell-recorders | |
| ref: ${{ steps.resolve-ref.outputs.ref }} | |
| path: ${{ github.workspace }}/../codetracer-shell-recorders | |
| gh-token: ${{ secrets.GH_READ_METACRAFT_PRIVATE_REPOS }} | |
| - name: Build shell trace writer | |
| run: | | |
| CLONE_DIR="$(pwd)/../codetracer-shell-recorders" | |
| nix develop .#devShells.x86_64-linux.default --command \ | |
| bash -c "cd '$CLONE_DIR' && cargo build" | |
| - name: Run shell-recorder integration tests | |
| run: | | |
| CLONE_DIR="$(pwd)/../codetracer-shell-recorders" | |
| BASH_RECORDER="${CLONE_DIR}/bash-recorder/launcher.sh" | |
| ZSH_RECORDER="${CLONE_DIR}/zsh-recorder/launcher.zsh" | |
| echo "Using bash recorder: $BASH_RECORDER" | |
| echo "Using zsh recorder: $ZSH_RECORDER" | |
| nix develop .#devShells.x86_64-linux.default --command \ | |
| bash -c " | |
| export CODETRACER_BASH_RECORDER_PATH='${BASH_RECORDER}' | |
| export CODETRACER_ZSH_RECORDER_PATH='${ZSH_RECORDER}' | |
| cd src/db-backend | |
| cargo test --test bash_flow_integration --test zsh_flow_integration -- --nocapture | |
| " | |
| - name: Upload test logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: shell-recorder-test-logs | |
| path: target/cross-test-logs/ | |
| retention-days: 14 | |
| if-no-files-found: ignore |