-
Notifications
You must be signed in to change notification settings - Fork 44
80 lines (68 loc) · 2.25 KB
/
Copy pathintegration-tests.yml
File metadata and controls
80 lines (68 loc) · 2.25 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
name: Integration Tests
on:
workflow_dispatch:
workflow_call:
push:
branches: ["main"]
pull_request_target:
types: [labeled]
env:
CARGO_TERM_COLOR: always
jobs:
integration-tests:
runs-on: ubuntu-latest
# Run if:
# 1. Manual trigger or push to main, OR
# 2. PR with "safe-to-test" label
if: |
github.event_name != 'pull_request_target' ||
contains(github.event.pull_request.labels.*.name, 'safe-to-test')
permissions:
id-token: write
contents: read
issues: write
pull-requests: write
env:
LABEL_NAME: safe-to-test
REPO: ${{ github.event.pull_request.base.repo.full_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.19.4
with:
egress-policy: audit
- name: Remove label
run: |
echo "Removing label '$LABEL_NAME' from PR #$PR_NUMBER on repo $REPO"
gh_status=$(gh api "repos/$REPO/issues/$PR_NUMBER/labels/$LABEL_NAME" -X DELETE | jq 'if type == "object" then .status else empty end' --raw-output)
case $gh_status in
"") echo "Label removed" ;;
404) echo "Label not found — ignoring" ;;
*) echo "unexpected HTTP $gh_status" && exit 1 ;;
esac
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v6
with:
role-to-assume: ${{ secrets.ROLE_ARN }}
role-session-name: aws-workload-credentials-provider-ci-${{ github.run_id }}
aws-region: us-west-2
- name: Build provider binary
run: cargo build
- name: Run integration tests
env:
ACM_TEST_ROLE_ARN: ${{ secrets.ACM_TEST_ROLE_ARN }}
ACM_TEST_CERTIFICATE_ARN: ${{ secrets.ACM_TEST_CERTIFICATE_ARN }}
run: |
cd integration-tests
cargo test -- --test-threads=1