Daily CLI Tests #353
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Daily CLI Tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 9 * * 1,2,3,4,5" | |
| jobs: | |
| set-trail-name: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| trail_name: ${{ steps.prep.outputs.trail_name }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@v7 | |
| - name: Prepare | |
| id: prep | |
| run: | | |
| TRAIL_NAME=$GITHUB_SHA | |
| echo "TRAIL_NAME=${TRAIL_NAME}" >> $GITHUB_ENV | |
| echo "trail_name=$TRAIL_NAME" >> $GITHUB_OUTPUT | |
| test: | |
| needs: [set-trail-name] | |
| uses: ./.github/workflows/test.yml | |
| with: | |
| AWS_ACCOUNT_ID: 772819027869 | |
| AWS_REGION: eu-central-1 | |
| FLOW_NAME: cli-daily-tests | |
| TRAIL_NAME: ${{ needs.set-trail-name.outputs.trail_name }} | |
| KOSLI_ORG: kosli-public | |
| run_lint: false | |
| run_snyk: false | |
| report_to_kosli: 'none' | |
| secrets: | |
| github_access_token: ${{ secrets.KOSLI_GITHUB_TOKEN }} | |
| gitlab_access_token: ${{ secrets.KOSLI_GITLAB_TOKEN }} | |
| azure_access_token: ${{ secrets.KOSLI_AZURE_TOKEN }} | |
| azure_client_id: ${{ secrets.AZURE_CLIENT_ID }} | |
| azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
| bitbucket_access_token: ${{ secrets.KOSLI_BITBUCKET_ACCESS_TOKEN }} | |
| jira_api_token: ${{ secrets.KOSLI_JIRA_API_TOKEN }} | |
| slack_webhook: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }} | |
| slack_channel: ci-failures | |
| snyk_token: ${{ secrets.SNYK_TOKEN }} | |
| kosli_reporting_api_token: ${{ secrets.KOSLI_PUBLIC_API_TOKEN }} | |
| kosli_querying_api_token: ${{ secrets.KOSLI_API_TOKEN_PROD }} | |
| sonarqube_token: ${{ secrets.KOSLI_SONARQUBE_TOKEN }} | |
| contract-tests: | |
| name: Contract Tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version-file: '.go-version' | |
| check-latest: true | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: arn:aws:iam::772819027869:role/cli | |
| aws-region: eu-central-1 | |
| role-duration-seconds: 2400 | |
| role-session-name: ${{ github.event.repository.name }} | |
| - name: Run contract tests | |
| run: make test_contract | |
| env: | |
| KOSLI_GITHUB_TOKEN: ${{ secrets.KOSLI_GITHUB_TOKEN }} | |
| slack-notification-on-failure: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| actions: read | |
| contents: read | |
| needs: | |
| [ | |
| set-trail-name, | |
| test, | |
| contract-tests, | |
| ] | |
| if: ${{ always() && contains(join(needs.*.result, ','), 'failure') && github.ref == 'refs/heads/main' }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Slack Notification on Failure | |
| uses: kosli-dev/reusable-actions/.github/actions/send-ci-failure-slack-message@main | |
| with: | |
| slack_url: ${{ secrets.MERKELY_SLACK_CI_FAILURES_WEBHOOK }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |