URL Test CI #4
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: URL Test CI | |
| on: | |
| schedule: | |
| - cron: '0 9 * * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit_tests: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Configure git | |
| run: 'git config --global init.defaultBranch main' | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # tag v7.0.0 | |
| # - curl is needed for Curb | |
| # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 | |
| # - sasl is needed for memcached | |
| - name: Install OS packages | |
| run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev | |
| - name: Install Ruby 3.4 | |
| uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # tag v1.315.0 | |
| with: | |
| ruby-version: 3.4 | |
| - name: Setup bundler | |
| run: ./.github/workflows/scripts/setup_bundler | |
| env: | |
| RUBY_VERSION: 3.4 | |
| - name: Run Unit Tests | |
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # tag v4.0.0 | |
| with: | |
| timeout_minutes: 30 | |
| max_attempts: 2 | |
| command: TEST=test/new_relic/healthy_urls_test bundle exec rake test | |
| env: | |
| VERBOSE_TEST_OUTPUT: true | |
| SPECIAL_CI: true | |
| notify_slack_fail: | |
| name: Notify slack fail | |
| needs: [unit_tests] | |
| runs-on: ubuntu-22.04 | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # tag v7.0.0 | |
| - uses: ./.github/actions/workflow-conclusion | |
| - uses: voxmedia/github-action-slack-notify-build@373da97827332b19e753c84d1e5b7937dbe0fbfa # tag v2 | |
| if: ${{ env.WORKFLOW_CONCLUSION == 'failure' && github.event_name != 'workflow_dispatch' }} | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.RUBY_GITHUB_ACTIONS_BOT_WEBHOOK }} | |
| with: | |
| channel: ruby-agent-notifications | |
| status: FAILED | |
| color: danger | |
| notify_slack_success: | |
| name: Notify slack success | |
| needs: [unit_tests] | |
| runs-on: ubuntu-22.04 | |
| if: always() | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # tag v7.0.0 | |
| - uses: ./.github/actions/workflow-conclusion | |
| - run: echo ${{ github.event_name }} | |
| - uses: Mercymeilya/last-workflow-status@f86bce177498d6fdd3bda4113d7d93266cfc3fca # tag v0.3.5 | |
| id: last_status | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: voxmedia/github-action-slack-notify-build@373da97827332b19e753c84d1e5b7937dbe0fbfa # tag v2 | |
| if: ${{ env.WORKFLOW_CONCLUSION == 'success' && steps.last_status.outputs.last_status == 'failure' && github.event_name != 'workflow_dispatch' }} | |
| env: | |
| SLACK_BOT_TOKEN: ${{ secrets.RUBY_GITHUB_ACTIONS_BOT_WEBHOOK }} | |
| with: | |
| channel: ruby-agent-notifications | |
| status: SUCCESS | |
| color: good |