Skip to content

tosquash

tosquash #11

Workflow file for this run

# Please do NOT manually edit this file.
# This file is generated by 'bundle exec rake github:actions:test_template'
---
name: Unit Tests
'on':
- push
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/master' }}"
jobs:
compute_tasks:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
engine:
- name: ruby
version: '3.3'
alias: ruby-33
- name: ruby
version: '3.2'
alias: ruby-32
container:
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}
outputs:
ruby-33-matrix: "${{ steps.set-matrix.outputs.ruby-33 }}"
ruby-32-matrix: "${{ steps.set-matrix.outputs.ruby-32 }}"
steps:
- uses: actions/checkout@v4
- run: bundle install
- id: set-matrix
run: |
matrix_json=$(bundle exec rake github:generate_matrix)
# Debug output
echo "Generated JSON:"
echo "$matrix_json"
# Set the output
echo "${{ matrix.engine.alias }}=$(echo "$matrix_json")" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: bundled-lock-${{ github.run_id }}-${{ matrix.engine.alias }}
retention-days: 1
path: 'Gemfile.lock
'
test-ruby-33:
name: 'ruby-3.3: ${{ matrix.task }} (${{ matrix.group }})'
needs:
- compute_tasks
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include: "${{ fromJSON(needs.compute_tasks.outputs.ruby-33-matrix) }}"
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.3
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/download-artifact@v4
with:
name: bundled-lock-${{ github.run_id }}-ruby-33
- run: bundle install && bundle exec rake compile_ext
- name: Test ${{ matrix.task }} with ${{ matrix.gemfile }}
run: bundle exec rake spec:${{ matrix.task }}
test-ruby-32:
name: 'ruby-3.2: ${{ matrix.task }} (${{ matrix.group }})'
needs:
- compute_tasks
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include: "${{ fromJSON(needs.compute_tasks.outputs.ruby-32-matrix) }}"
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.2
env:
BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/download-artifact@v4
with:
name: bundled-lock-${{ github.run_id }}-ruby-32
- run: bundle install && bundle exec rake compile_ext
- name: Test ${{ matrix.task }} with ${{ matrix.gemfile }}
run: bundle exec rake spec:${{ matrix.task }}