Skip to content

Commit 80366c7

Browse files
committed
feat(ci): run integration tests on Dependabot PRs
1 parent a9cd37f commit 80366c7

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Dependabot Integration Tests
2+
3+
# Dependabot's pull_request runs are sandboxed: secrets and vars resolve empty,
4+
# so the normal Integration Tests workflow skips every credentialed scenario and
5+
# a behavioral regression in a bump would go unnoticed. This workflow runs the
6+
# real integration suite for Dependabot bumps via pull_request_target, which
7+
# executes in the base-repo context where the test credentials are available.
8+
#
9+
# Security posture (pull_request_target runs trusted-context with secrets):
10+
# - Gated to dependabot[bot], so no fork PR can trigger a credentialed run.
11+
# - permissions: contents: read only — the suite talks to the Hotdata API, not
12+
# GitHub, so no writable GITHUB_TOKEN is ever exposed to the build.
13+
# - No shared cargo cache: building the bumped crate runs its build scripts, so
14+
# we never persist a cache other workflows could restore.
15+
# The bumped dependency's code still runs with the (test-scoped) API key present;
16+
# that is inherent to live coverage and is bounded to Dependabot-authored runs.
17+
18+
on:
19+
pull_request_target:
20+
types: [opened, synchronize, reopened]
21+
22+
permissions:
23+
contents: read
24+
25+
concurrency:
26+
group: dependabot-integration-${{ github.event.pull_request.number }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
integration:
31+
if: github.event.pull_request.user.login == 'dependabot[bot]'
32+
runs-on: ubuntu-latest
33+
steps:
34+
# pull_request_target defaults to the base ref; check out the PR head so we
35+
# build against the bumped Cargo.lock.
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
37+
with:
38+
ref: ${{ github.event.pull_request.head.sha }}
39+
- name: Install Rust
40+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
41+
- name: Run integration tests
42+
env:
43+
HOTDATA_SDK_TEST_API_URL: ${{ vars.HOTDATA_SDK_TEST_API_URL }}
44+
HOTDATA_SDK_TEST_API_KEY: ${{ secrets.HOTDATA_SDK_TEST_API_KEY }}
45+
HOTDATA_SDK_TEST_WORKSPACE_ID: ${{ vars.HOTDATA_SDK_TEST_WORKSPACE_ID }}
46+
HOTDATA_SDK_TEST_CONNECTION_ID: ${{ vars.HOTDATA_SDK_TEST_CONNECTION_ID }}
47+
# --no-fail-fast runs every scenario binary even after one fails, so a
48+
# red run surfaces all failing scenarios at once.
49+
run: cargo test --test '*' --no-fail-fast -- --nocapture

0 commit comments

Comments
 (0)