|
1 | 1 | name: Integration Tests |
2 | 2 | on: |
3 | | - workflow_dispatch: null |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + use_minimal_test_account: |
| 6 | + description: 'Use minimal test account' |
| 7 | + required: false |
| 8 | + default: 'false' |
| 9 | + sha: |
| 10 | + description: 'The hash value of the commit.' |
| 11 | + required: false |
| 12 | + default: '' |
4 | 13 | push: |
5 | 14 | branches: |
6 | 15 | - main |
|
9 | 18 | integration-tests: |
10 | 19 | name: Run integration tests |
11 | 20 | runs-on: ubuntu-latest |
12 | | - env: |
13 | | - EXIT_STATUS: 0 |
14 | 21 | steps: |
15 | | - - name: Clone Repository |
16 | | - uses: actions/checkout@v3 |
| 22 | + - name: Clone Repository with SHA |
| 23 | + if: ${{ inputs.sha != '' }} |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + submodules: 'recursive' |
| 28 | + ref: ${{ inputs.sha }} |
| 29 | + |
| 30 | + - name: Clone Repository without SHA |
| 31 | + if: ${{ inputs.sha == '' }} |
| 32 | + uses: actions/checkout@v4 |
17 | 33 | with: |
18 | 34 | fetch-depth: 0 |
19 | 35 | submodules: 'recursive' |
@@ -45,20 +61,22 @@ jobs: |
45 | 61 | env: |
46 | 62 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
47 | 63 |
|
| 64 | + - name: Set LINODE_CLI_TOKEN |
| 65 | + run: | |
| 66 | + echo "LINODE_CLI_TOKEN=${{ secrets[inputs.use_minimal_test_account == 'true' && 'MINIMAL_LINODE_TOKEN' || 'LINODE_TOKEN'] }}" >> $GITHUB_ENV |
| 67 | +
|
48 | 68 | - name: Run the integration test suite |
49 | 69 | run: | |
50 | 70 | timestamp=$(date +'%Y%m%d%H%M') |
51 | 71 | report_filename="${timestamp}_cli_test_report.xml" |
52 | 72 | make testint TEST_ARGS="--junitxml=${report_filename}" |
53 | | - env: |
54 | | - LINODE_CLI_TOKEN: ${{ secrets.LINODE_TOKEN }} |
55 | 73 |
|
56 | 74 | - name: Apply Calico Rules to LKE |
57 | 75 | if: always() |
58 | 76 | run: | |
59 | 77 | cd scripts && ./lke_calico_rules_e2e.sh |
60 | 78 | env: |
61 | | - LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }} |
| 79 | + LINODE_TOKEN: ${{ env.LINODE_CLI_TOKEN }} |
62 | 80 |
|
63 | 81 | - name: Upload test results |
64 | 82 | if: always() |
|
0 commit comments