Skip to content

Merge branch 'master' into fix-gha-secret #107

Merge branch 'master' into fix-gha-secret

Merge branch 'master' into fix-gha-secret #107

Workflow file for this run

name: Test
on:
push:
workflow_call:
secrets:
SLACK_BOT_TOKEN:
required: true
schedule:
- cron: '0 7 * * *' # every day at 10:00 UTC
jobs:
test:
runs-on: ubuntu-latest
container:
image: ruby:${{ matrix.ruby_version }}
# https://github.com/actions/runner/issues/2033#issuecomment-1598547465
# fatal: detected dubious ownership in repository
options: --user 1001
name: Test ${{ matrix.ruby_version }}
strategy:
matrix:
ruby_version:
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
steps:
- uses: actions/checkout@v4
- name: Ruby version
run: ruby -v
- name: Gem version
run: gem -v
- name: Bundler version
run: bundle -v
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake spec
- name: Run tests with ITR
env:
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_CIVISIBILITY_ITR_ENABLED: true
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_ENV: ci
run: bundle exec rake spec
notify:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- if: ${{ needs.test.result == 'success' }}
name: Notify success
uses: ./.github/actions/slack
with:
message: |-
:github-check: ${{ github.ref_type }}: ${{ github.ref_name }}
:github: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
channel: ${{ vars.SLACK_CHANNEL_ID }}
token: ${{ secrets.SLACK_BOT_TOKEN }}
- if: ${{ needs.test.result == 'failure' }}
uses: ./.github/actions/slack
name: Notify failure
with:
message: |-
:red-light: ${{ github.ref_type }}: ${{ github.ref_name }}
:github: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
channel: ${{ vars.SLACK_CHANNEL_ID }}
token: ${{ secrets.SLACK_BOT_TOKEN }}