|
1 | 1 | name: "Tests: Integration"
|
2 | 2 |
|
3 |
| -run-name: "Integration [${{ github.event.workflow_run.head_branch }}]: ${{ github.event.workflow_run.head_commit.message }}" |
| 3 | +run-name: "Integration [${{ github.event_name }}: ${{ github.event.pull_request.head.sha || github.event.push.after || github.event.workflow_run.head_sha}}]: ${{ github.event.workflow_run.head_commit.message }}" |
4 | 4 |
|
5 | 5 | on:
|
6 |
| - workflow_call: |
7 |
| - inputs: |
8 |
| - workflow: |
9 |
| - default: all |
10 |
| - type: string |
11 | 6 | workflow_dispatch:
|
12 | 7 | inputs:
|
13 | 8 | workflow:
|
14 | 9 | description: Tests to run
|
15 | 10 | required: true
|
16 | 11 | type: choice
|
17 | 12 | options:
|
| 13 | + - all |
18 | 14 | - run-integration-tests-cf-env
|
19 |
| - - run-integration-tests-cf-env-with-client-creds |
20 | 15 | # - run-integration-tests-cf-env-with-min-capi
|
21 | 16 | # - run-integration-windows
|
22 | 17 | # - run-integration-windows-client-credentials
|
| 18 | + push: |
| 19 | + tags: |
| 20 | + - "v9.*" |
| 21 | + - "v8.*" |
| 22 | + - "v7.*" |
| 23 | + pull_request_target: |
| 24 | + branches: |
| 25 | + - main |
| 26 | + - v9 |
| 27 | + - v8 |
| 28 | + - v7 |
| 29 | + paths-ignore: |
| 30 | + - "doc/**" |
| 31 | + - ".gitpod.yml" |
| 32 | + - "README.md" |
23 | 33 | jobs:
|
| 34 | + get-sha: |
| 35 | + runs-on: ubuntu-latest |
| 36 | + outputs: |
| 37 | + gitRef: ${{steps.calculate.outputs.ref}} |
| 38 | + steps: |
| 39 | + - id: calculate |
| 40 | + run: | |
| 41 | + if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then |
| 42 | + echo "checkout pull request head ${{ github.event.pull_request.head.sha }}" |
| 43 | + echo "ref=${{ github.event.pull_request.head.sha }}" >> $GITHUB_OUTPUT |
| 44 | + elif [[ "${{ github.event_name }}" == "push" ]]; then |
| 45 | + echo "checkout push request ${{github.event.push.after}}" |
| 46 | + echo "ref=${{github.event.push.after}}" >> $GITHUB_OUTPUT |
| 47 | + else |
| 48 | + echo "checkout else ${{ github.event.workflow_run.head_sha }}" |
| 49 | + echo "ref=${{github.event.workflow_run.head_sha}}" >> $GITHUB_OUTPUT |
| 50 | + fi |
| 51 | + units: |
| 52 | + name: Basic units to gate for integration tests |
| 53 | + runs-on: ubuntu-latest |
| 54 | + needs: |
| 55 | + - get-sha |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + ref: ${{needs.get-sha.outputs.gitRef}} |
| 61 | + - name: Set Up Go |
| 62 | + uses: actions/setup-go@v5 |
| 63 | + with: |
| 64 | + go-version-file: go.mod |
| 65 | + check-latest: true |
| 66 | + - name: Run Units |
| 67 | + run: make units |
24 | 68 | run-integration-tests-cf-env:
|
25 | 69 | name: Integration tests
|
26 |
| - if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env' }} |
| 70 | + needs: |
| 71 | + - get-sha |
| 72 | + - units |
| 73 | + if: ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env' }} |
27 | 74 | uses: ./.github/workflows/tests-integration-reusable.yml
|
28 | 75 | with:
|
29 | 76 | capi-version: edge
|
30 | 77 | run-with-client-creds: false
|
31 | 78 | os: ubuntu-latest
|
32 | 79 | name: Integration
|
| 80 | + gitRef: ${{needs.get-sha.outputs.gitRef}} |
33 | 81 | secrets: inherit
|
34 | 82 |
|
35 | 83 | run-integration-tests-cf-env-with-client-creds:
|
36 | 84 | name: client creds
|
37 |
| - if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-client-creds' }} |
| 85 | + needs: |
| 86 | + - get-sha |
| 87 | + - units |
| 88 | + if: ${{ github.event_name != 'workflow_dispatch' || inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-client-creds' }} |
38 | 89 | uses: ./.github/workflows/tests-integration-reusable.yml
|
39 | 90 | with:
|
40 | 91 | capi-version: edge
|
41 | 92 | run-with-client-creds: true
|
42 | 93 | os: ubuntu-latest
|
43 | 94 | name: Integration client creds
|
| 95 | + gitRef: ${{needs.get-sha.outputs.gitRef}} |
44 | 96 | secrets: inherit
|
45 | 97 |
|
46 | 98 | #run-integration-tests-cf-env-with-min-capi:
|
47 | 99 | # name: MIN CAPI
|
48 |
| - # if: ${{ inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }} |
| 100 | + # needs: |
| 101 | + # - get-sha |
| 102 | + # - units |
| 103 | + # if: ${{ github.event_name != 'workflow_dispatch' ||inputs.workflow == 'all' || inputs.workflow == 'run-integration-tests-cf-env-with-min-capi' }} |
49 | 104 | # uses: ./.github/workflows/tests-integration-reusable.yml
|
50 | 105 | # with:
|
51 | 106 | # capi-version: min
|
|
0 commit comments