Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Sep 18, 2024
1 parent 4dd912a commit 8573aa7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 16 deletions.
13 changes: 13 additions & 0 deletions .github/filters.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gemfile:
# Files that declare the dependency tree
- Gemfile
- Appraisals
- datadog.gemspec
# Files that control gemfile generation
- tasks/appraisal.rake
- .github/workflows/lock-dependency.yml
# The gem version is present in all lock files
- lib/datadog/version.rb
# In case the generated files were updated manually or in a merge commit
- appraisal/**
- gemfiles/**
43 changes: 27 additions & 16 deletions .github/workflows/lock-dependency.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
name: Lock Dependency

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to be lock dependency'
required: true
# Testing purpose, to be removed before merge.
push:
branches:
- tonycthsu/automate-update-gemfiles

# 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:
# TODO: In order to fully automate this workflow for each PR,
# have a reliable way to precheck job to understand whether it need to be updated
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.yaml
lock:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.gemfile == 'true' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -42,12 +53,12 @@ jobs:
version: '2.6'
- name: ruby
version: '2.5'
- name: jruby
version: '9.4'
- name: jruby
version: '9.3'
- name: jruby
version: '9.2'
# - 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:
Expand Down

0 comments on commit 8573aa7

Please sign in to comment.