|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.head_ref || github.run_id }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + lint_typescript: |
| 14 | + name: Lint and Typescript checks |
| 15 | + uses: ./.github/workflows/lint-typescript.yml |
| 16 | + secrets: inherit |
| 17 | + |
| 18 | + unit_tests: |
| 19 | + name: Unit tests |
| 20 | + uses: ./.github/workflows/unit.yml |
| 21 | + secrets: inherit |
| 22 | + |
| 23 | + e2e_tests: |
| 24 | + name: End-to-end tests |
| 25 | + uses: ./.github/workflows/e2e.yml |
| 26 | + secrets: inherit |
| 27 | + |
| 28 | + secrets_scan: |
| 29 | + name: Secrets scan |
| 30 | + uses: ./.github/workflows/secrets-scan.yml |
| 31 | + secrets: inherit |
| 32 | + |
| 33 | + notify_slack_success: |
| 34 | + name: Notify success status to Slack |
| 35 | + runs-on: ubuntu-latest |
| 36 | + if: success() && github.ref == 'refs/heads/master' && github.event_name == 'push' |
| 37 | + needs: [lint_typescript, unit_tests, e2e_tests, secrets_scan] |
| 38 | + permissions: |
| 39 | + actions: read |
| 40 | + contents: read |
| 41 | + id-token: write |
| 42 | + steps: |
| 43 | + - name: GSM Secrets |
| 44 | + id: secrets_manager |
| 45 | + uses: toptal/actions/gsm-secrets@main |
| 46 | + with: |
| 47 | + workload_identity_provider: projects/858873486241/locations/global/workloadIdentityPools/gha-pool/providers/github-com |
| 48 | + service_account: gha-keycodes@toptal-ci.iam.gserviceaccount.com |
| 49 | + secrets_name: |- |
| 50 | + SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK:toptal-ci/SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK |
| 51 | + SLACK_TEST_PUB_BOT_WEBHOOK:toptal-ci/SLACK_TEST_PUB_BOT_WEBHOOK |
| 52 | +
|
| 53 | + - name: Parse secrets |
| 54 | + id: parse_secrets |
| 55 | + uses: toptal/actions/expose-json-outputs@main |
| 56 | + with: |
| 57 | + json: ${{ steps.secrets_manager.outputs.secrets }} |
| 58 | + |
| 59 | + - uses: toptal/slack-workflow-status@master |
| 60 | + with: |
| 61 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 62 | + slack_webhook_url: ${{ steps.parse_secrets.outputs.SLACK_MARKETING_TOOLS_2_RELEASES_WEBHOOK }} |
| 63 | + name: gha-bot |
| 64 | + icon_url: https://avatars.slack-edge.com/2021-05-17/2068859221653_526c61e414df90dd67f7_192.png |
| 65 | + include_jobs: on-failure |
| 66 | + display_only_failed: true |
| 67 | + include_commit_message: true |
| 68 | + |
| 69 | + notify_slack_failure: |
| 70 | + name: Notify failure status to Slack |
| 71 | + runs-on: ubuntu-latest |
| 72 | + if: (failure() || cancelled()) && github.ref == 'refs/heads/master' && github.event_name == 'push' |
| 73 | + needs: [lint_typescript, unit_tests, e2e_tests, secrets_scan] |
| 74 | + permissions: |
| 75 | + actions: read |
| 76 | + contents: read |
| 77 | + id-token: write |
| 78 | + steps: |
| 79 | + - name: GSM Secrets |
| 80 | + id: secrets_manager |
| 81 | + uses: toptal/actions/gsm-secrets@main |
| 82 | + with: |
| 83 | + workload_identity_provider: projects/858873486241/locations/global/workloadIdentityPools/gha-pool/providers/github-com |
| 84 | + service_account: gha-keycodes@toptal-ci.iam.gserviceaccount.com |
| 85 | + secrets_name: |- |
| 86 | + SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK:toptal-ci/SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK |
| 87 | + SLACK_TEST_PUB_BOT_WEBHOOK:toptal-ci/SLACK_TEST_PUB_BOT_WEBHOOK |
| 88 | +
|
| 89 | + - name: Parse secrets |
| 90 | + id: parse_secrets |
| 91 | + uses: toptal/actions/expose-json-outputs@main |
| 92 | + with: |
| 93 | + json: ${{ steps.secrets_manager.outputs.secrets }} |
| 94 | + |
| 95 | + - uses: toptal/slack-workflow-status@master |
| 96 | + with: |
| 97 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + slack_webhook_url: ${{ steps.parse_secrets.outputs.SLACK_MARKETING_TOOLS_2_BULLHORN_WEBHOOK }} |
| 99 | + name: gha-bot |
| 100 | + icon_url: https://avatars.slack-edge.com/2021-05-17/2068859221653_526c61e414df90dd67f7_192.png |
| 101 | + include_jobs: on-failure |
| 102 | + display_only_failed: true |
| 103 | + include_commit_message: true |
| 104 | + |
0 commit comments