-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
127 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,80 @@ | ||
--- | ||
name: Test | ||
|
||
on: | ||
push: | ||
|
||
'on': | ||
- push | ||
jobs: | ||
generate-matrices: | ||
comput_matrices: | ||
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" } | ||
- { name: "ruby", version: "3.1", alias: "ruby-31" } | ||
- name: ruby | ||
version: '3.3' | ||
alias: ruby-33 | ||
- name: ruby | ||
version: '3.2' | ||
alias: ruby-32 | ||
- name: ruby | ||
version: '3.1' | ||
alias: ruby-31 | ||
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 }} | ||
ruby-31-matrix: ${{ steps.set-matrix.outputs.ruby-31 }} | ||
ruby-33-matrix: "${{ steps.set-matrix.outputs.ruby-33 }}" | ||
ruby-32-matrix: "${{ steps.set-matrix.outputs.ruby-32 }}" | ||
ruby-31-matrix: "${{ steps.set-matrix.outputs.ruby-31 }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: apt update && apt install jq -y | ||
- name: Bundle install | ||
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" | jq -c .)" >> $GITHUB_OUTPUT | ||
test-ruby-33: | ||
name: Test Ruby 3.3 | ||
needs: generate-matrices | ||
- uses: actions/checkout@v4 | ||
- run: apt update && apt install jq -y | ||
- 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" | jq -c .)" >> $GITHUB_OUTPUT | ||
test-ruby-31: | ||
name: Test on ruby 3.1 | ||
needs: comput_matrices | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJson(needs.generate-matrices.outputs.ruby-33-matrix) }} | ||
include: "${{ needs.comput_matrices.outputs.ruby-31-matrix }}" | ||
container: | ||
image: ghcr.io/datadog/images-rb/engines/ruby:3.3 | ||
image: ghcr.io/datadog/images-rb/engines/ruby:3.1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Bundle install | ||
run: bundle install | ||
- name: Run tests | ||
run: bundle exec rake test:${{ matrix.task }} | ||
|
||
- uses: actions/checkout@v4 | ||
- run: bundle install | ||
- run: bundle exec rake test:${{ matrix.task }} | ||
test-ruby-32: | ||
name: Test Ruby 3.2 | ||
needs: generate-matrices | ||
name: Test on ruby 3.2 | ||
needs: comput_matrices | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJson(needs.generate-matrices.outputs.ruby-32-matrix) }} | ||
include: "${{ needs.comput_matrices.outputs.ruby-32-matrix }}" | ||
container: | ||
image: ghcr.io/datadog/images-rb/engines/ruby:3.2 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Bundle install | ||
run: bundle install | ||
- name: Run tests | ||
run: bundle exec rake test:${{ matrix.task }} | ||
|
||
test-ruby-31: | ||
name: Test Ruby 3.1 | ||
needs: generate-matrices | ||
- uses: actions/checkout@v4 | ||
- run: bundle install | ||
- run: bundle exec rake test:${{ matrix.task }} | ||
test-ruby-33: | ||
name: Test on ruby 3.3 | ||
needs: comput_matrices | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJson(needs.generate-matrices.outputs.ruby-31-matrix) }} | ||
include: "${{ needs.comput_matrices.outputs.ruby-33-matrix }}" | ||
container: | ||
image: ghcr.io/datadog/images-rb/engines/ruby:3.1 | ||
image: ghcr.io/datadog/images-rb/engines/ruby:3.3 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Bundle install | ||
run: bundle install | ||
- name: Run tests | ||
run: bundle exec rake test:${{ matrix.task }} | ||
- uses: actions/checkout@v4 | ||
- run: bundle install | ||
- run: bundle exec rake test:${{ matrix.task }} |
This file contains 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