-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into disable-env-logs
- Loading branch information
Showing
24 changed files
with
943 additions
and
301 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 |
---|---|---|
@@ -0,0 +1,133 @@ | ||
# Please do NOT manually edit this file. | ||
# This file is generated by 'bundle exec rake github:actions:test_template' | ||
--- | ||
name: Unit Tests | ||
'on': | ||
push: | ||
branches: | ||
- master | ||
- poc/** | ||
schedule: | ||
- cron: 0 7 * * * | ||
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 | ||
- run: bundle cache | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: bundled-dependencies-${{ github.run_id }}-${{ matrix.engine.alias }} | ||
retention-days: 1 | ||
path: | | ||
Gemfile.lock | ||
vendor/ | ||
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: | ||
TEST_POSTGRES_HOST: postgres | ||
TEST_REDIS_HOST: redis | ||
services: | ||
postgres: | ||
image: postgres:9.6 | ||
credentials: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
redis: | ||
image: redis:6.2 | ||
credentials: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
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-dependencies-${{ github.run_id }}-ruby-33 | ||
- run: bundle install --local | ||
- name: Test ${{ matrix.task }} with ${{ matrix.gemfile }} | ||
env: | ||
BUNDLE_GEMFILE: "${{ matrix.gemfile }}" | ||
run: bundle install && 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: | ||
TEST_POSTGRES_HOST: postgres | ||
TEST_REDIS_HOST: redis | ||
services: | ||
postgres: | ||
image: postgres:9.6 | ||
credentials: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
redis: | ||
image: redis:6.2 | ||
credentials: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_TOKEN }}" | ||
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-dependencies-${{ github.run_id }}-ruby-32 | ||
- run: bundle install --local | ||
- name: Test ${{ matrix.task }} with ${{ matrix.gemfile }} | ||
env: | ||
BUNDLE_GEMFILE: "${{ matrix.gemfile }}" | ||
run: bundle install && bundle exec rake spec:${{ 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
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,6 +1,7 @@ | ||
{ | ||
"files.associations": { | ||
"*.gemfile": "ruby", | ||
"Matrixfile": "ruby", | ||
"Dockerfile*": "dockerfile" | ||
} | ||
} |
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
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
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
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
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
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
Oops, something went wrong.