|
1 |
| -# This workflow runs acceptance tests on pull requests (both CE and EE). It needs to be run in the |
| 1 | +# This workflow runs acceptance tests on pull requests (EE). It needs to be run in the |
2 | 2 | # target project instead of the fork in order to use secrets. This is why the actions/checkout
|
3 | 3 | # action regularly has to specify the pull request sha.
|
4 | 4 | #
|
5 | 5 | # SECURITY ADVISORY
|
6 | 6 | # Be careful while making changes to this file.
|
7 | 7 | # See: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
|
8 | 8 |
|
9 |
| -name: pr-acceptance |
| 9 | +name: pr-acceptance-ee |
10 | 10 |
|
11 | 11 | on:
|
12 | 12 | # The pull_request_target event type fires for pull requests, but in the context of the target
|
13 | 13 | # project.
|
14 | 14 | pull_request_target:
|
| 15 | + types: [labeled] |
15 | 16 | # Acceptance tests are unnecessary to run on some types of PRs.
|
16 | 17 | paths-ignore:
|
17 | 18 | - 'docs/**'
|
@@ -51,32 +52,10 @@ jobs:
|
51 | 52 | if: ${{ env.LICENSE_ENCRYPTION_PASSWORD != '' }}
|
52 | 53 | run: echo "::set-output name=defined::true"
|
53 | 54 |
|
54 |
| - acceptance-ce: |
55 |
| - timeout-minutes: 60 |
56 |
| - runs-on: ubuntu-latest |
57 |
| - needs: [go-version] |
58 |
| - steps: |
59 |
| - - uses: actions/setup-go@v2 |
60 |
| - with: |
61 |
| - go-version: ${{ needs.go-version.outputs.go-version }} |
62 |
| - # Check out the pull request code (as opposed to the target project). |
63 |
| - - uses: actions/checkout@v2 |
64 |
| - with: |
65 |
| - ref: ${{ github.event.pull_request.head.sha }} |
66 |
| - # Cache the Go modules. |
67 |
| - - uses: actions/cache@v2 |
68 |
| - with: |
69 |
| - path: ~/go/pkg/mod |
70 |
| - key: ${{ github.job }}-${{ runner.os }}-go${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'GNUMakefile') }} |
71 |
| - # CAUTION: EXECUTING UNTRUSTED CODE. |
72 |
| - # This is made safe because we have not referenced any secrets or GitHub tokens. |
73 |
| - - run: make testacc-up |
74 |
| - - run: make testacc |
75 |
| - |
76 | 55 | acceptance-ee:
|
77 | 56 | # Only run EE tests if the LICENSE_ENCRYPTION_PASSWORD secret exists, so that the workflow
|
78 | 57 | # doesn't fail when code is pushed to a fork.
|
79 |
| - if: ${{ needs.license-encryption-password.outputs.defined }} |
| 58 | + if: needs.license-encryption-password.outputs.defined && contains(github.event.pull_request.labels.*.name, 'safe to test') |
80 | 59 | timeout-minutes: 60
|
81 | 60 | runs-on: ubuntu-latest
|
82 | 61 | needs: [go-version, license-encryption-password]
|
|
107 | 86 | # This is made safe because we have already cleaned up the unencrypted GitLab license file,
|
108 | 87 | # we have no other secrets, and we are not using GitHub tokens.
|
109 | 88 | - run: make testacc
|
| 89 | + |
0 commit comments