Workflow file for this run
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
name: Lock Dependency | |
on: | |
push: | |
# Ensure obsolete job is cancelled if another commit is pushed to the same branch. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
steps: | |
# Only execute if there's a PR attached to this branch. | |
# Because we execute on `push`, we have to double check here if this is part of a PR. | |
- name: Check if this branch is attached to a Pull Request | |
uses: 8BitJonny/[email protected] | |
id: pr | |
with: | |
filterOutClosed: true # Don't trigger on commits with closed PRs, including merges into `master`. | |
- if: steps.pr.outputs.pr_found == 'true' | |
uses: actions/checkout@v4 | |
# And also, only execute if files that can affect gemfiles are modified. | |
- if: steps.pr.outputs.pr_found == 'true' | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
base: ${{ github.ref_name }} | |
filters: .github/filters.yml | |
lock: | |
runs-on: ubuntu-latest | |
needs: changes | |
if: ${{ needs.changes.outputs.gemfile == 'true' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
engine: | |
# ADD NEW RUBIES HERE | |
- name: ruby | |
version: '3.4' | |
- name: ruby | |
version: '3.3' | |
- name: ruby | |
version: '3.2' | |
- name: ruby | |
version: '3.1' | |
- name: ruby | |
version: '3.0' | |
- name: ruby | |
version: '2.7' | |
- name: ruby | |
version: '2.6' | |
- name: ruby | |
version: '2.5' | |
# - name: jruby | |
# version: '9.4' | |
# - name: jruby | |
# version: '9.3' | |
# - name: jruby | |
# version: '9.2' | |
container: | |
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }} | |
env: | |
BUNDLE_WITHOUT: check | |
steps: | |
- uses: actions/checkout@v4 | |
- run: ls -al | |
- run: | | |
ruby -v | |
gem -v | |
bundler -v | |
- run: bundle install | |
# TODO: Migrate away from `appraisal` | |
- run: bundle exec appraisal generate | |
- run: bundle exec rake dependency:lock | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: lock-dependency-${{ github.run_id }}-${{ matrix.engine.name }}-${{ matrix.engine.version }} | |
path: gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}* | |
commit: | |
needs: lock | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: gemfiles | |
pattern: lock-dependency-${{ github.run_id }}-* | |
merge-multiple: true | |
- run: git diff --color | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
file_pattern: 'gemfiles/*' | |
commit_message: "[🤖] Lock Dependency: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" |