-
Notifications
You must be signed in to change notification settings - Fork 21
80 lines (74 loc) · 2.4 KB
/
Copy pathe2e_on_pull_request.yml
File metadata and controls
80 lines (74 loc) · 2.4 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: e2e test PR
on:
pull_request:
paths:
- "**"
- "!.github/**"
- ".github/actions/setup_nix/**"
- ".github/workflows/e2e.yml"
- ".github/workflows/e2e_on_pull_request.yml"
- "!dev-docs/**"
- "!docs/**"
- "!rfc/**"
- "!tools/vale/**"
# Cancel old runs of this workflow for this pull request if new commits are pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
plan:
name: Determine relevant tests
runs-on: ubuntu-24.04
permissions:
contents: read
outputs:
matrix: ${{ steps.select.outputs.matrix }}
any: ${{ steps.select.outputs.any }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
# Need the base commit in history to diff the PR against it.
fetch-depth: 25
- uses: ./.github/actions/setup_nix
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Select relevant e2e tests
id: select
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
arg="${BASE_SHA}"
matrix=$(nix run ".#base.scripts.select-e2e-tests" -- "${arg}")
echo "${matrix}" | jq
echo "matrix={\"include\":${matrix}}" >> "$GITHUB_OUTPUT"
if [[ "${matrix}" == "[]" ]]; then
echo "any=false" >> "$GITHUB_OUTPUT"
else
echo "any=true" >> "$GITHUB_OUTPUT"
fi
test_matrix:
needs: plan
if: needs.plan.outputs.any == 'true'
strategy:
matrix: ${{ fromJSON(needs.plan.outputs.matrix) }}
fail-fast: false
name: "${{ matrix.platform }} / ${{ matrix.test }}"
uses: ./.github/workflows/e2e.yml
with:
skip-undeploy: false
test-name: ${{ matrix.test }}
platform: ${{ matrix.platform }}
runner: ${{ matrix.runner }}
self-hosted: ${{ matrix.self-hosted }}
debug-shell: true
secrets:
GITHUB_TOKEN_IN: ${{ secrets.GITHUB_TOKEN }}
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
NUNKI_CI_COMMIT_PUSH_PR: ${{ secrets.NUNKI_CI_COMMIT_PUSH_PR }}
TEAMS_CI_WEBHOOK: ${{ secrets.TEAMS_CI_WEBHOOK }}
CONTRAST_GHCR_READ: ${{ secrets.CONTRAST_GHCR_READ }}
permissions:
contents: read
packages: write