|
4 | 4 | schedule: |
5 | 5 | - cron: "0 4 * * *" # every day at 4am UTC |
6 | 6 | workflow_dispatch: |
| 7 | + inputs: |
| 8 | + branch: |
| 9 | + description: 'Branch to run contract tests on' |
| 10 | + required: false |
| 11 | + default: '' |
| 12 | + test_slack_notification: |
| 13 | + description: 'Also send a test Slack notification (to verify Slack integration)' |
| 14 | + required: false |
| 15 | + type: boolean |
| 16 | + default: false |
7 | 17 |
|
8 | 18 | jobs: |
9 | 19 | nightly-contract-tests: |
10 | 20 | runs-on: ubuntu-latest |
11 | 21 | steps: |
12 | 22 | - uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + ref: ${{ inputs.branch || github.ref }} |
13 | 25 |
|
14 | 26 | - name: Shared CI Steps |
15 | 27 | uses: ./.github/actions/ci |
16 | 28 | with: |
17 | 29 | workspace_path: 'lib/sdk/server' |
18 | 30 | java_version: 8 |
19 | 31 |
|
20 | | - - name: Build Contract Tests |
21 | | - shell: bash |
22 | | - run: make build-contract-tests -C lib/sdk/server |
23 | | - |
24 | | - - name: Start Contract Test Service |
25 | | - shell: bash |
26 | | - run: make start-contract-test-service-bg -C lib/sdk/server |
27 | | - |
28 | | - - name: Run Contract Tests with Long-Running Tests |
29 | | - shell: bash |
30 | | - run: make run-contract-tests -C lib/sdk/server TEST_HARNESS_PARAMS="-enable-long-running-tests" |
| 32 | + - name: Contract Tests (with long-running tests) |
| 33 | + uses: ./.github/actions/contract-tests |
| 34 | + with: |
| 35 | + workspace_path: 'lib/sdk/server' |
| 36 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + test_harness_params: '-enable-long-running-tests' |
31 | 38 |
|
32 | 39 | notify-slack-on-failure: |
33 | 40 | runs-on: ubuntu-latest |
|
47 | 54 | "type": "section", |
48 | 55 | "text": { |
49 | 56 | "type": "mrkdwn", |
50 | | - "text": ":warning: *Nightly Contract Tests Failed* :warning:\nThe nightly contract tests (with long-running tests enabled) failed on `main`." |
| 57 | + "text": ":warning: *Nightly Contract Tests Failed* :warning:\nThe nightly contract tests (with long-running tests enabled) failed on `${{ github.ref_name }}`." |
51 | 58 | }, |
52 | 59 | "accessory": { |
53 | 60 | "type": "button", |
|
60 | 67 | } |
61 | 68 | ] |
62 | 69 | } |
| 70 | +
|
| 71 | + test-slack-notification: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + if: ${{ inputs.test_slack_notification == true || inputs.test_slack_notification == 'true' }} |
| 74 | + steps: |
| 75 | + - name: Send test Slack notification |
| 76 | + uses: slackapi/slack-github-action@v2.1.0 |
| 77 | + with: |
| 78 | + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 79 | + webhook-type: incoming-webhook |
| 80 | + payload: | |
| 81 | + { |
| 82 | + "blocks": [ |
| 83 | + { |
| 84 | + "type": "section", |
| 85 | + "text": { |
| 86 | + "type": "mrkdwn", |
| 87 | + "text": ":white_check_mark: *Nightly Contract Tests – Slack test*\nThis is a test notification to verify Slack integration is working. Triggered manually from the Nightly Contract Tests workflow." |
| 88 | + }, |
| 89 | + "accessory": { |
| 90 | + "type": "button", |
| 91 | + "text": { |
| 92 | + "type": "plain_text", |
| 93 | + "text": "View workflow run" |
| 94 | + }, |
| 95 | + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
| 96 | + } |
| 97 | + } |
| 98 | + ] |
| 99 | + } |
0 commit comments