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 fb4e67d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 16 deletions.
9 changes: 9 additions & 0 deletions .github/filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
gemfile:
- Gemfile
- Appraisals
- datadog.gemspec
- tasks/appraisal.rake
- .github/workflows/lock-dependency.yml
- lib/datadog/version.rb
- appraisal/**
- gemfiles/**
49 changes: 33 additions & 16 deletions .github/workflows/lock-dependency.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
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
pr:
runs-on: ubuntu-latest
outputs:
pr_found: ${{ steps.pr.outputs.pr_found }}
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/gh-get-current-pr@3.0.0
id: pr
with:
filterOutClosed: true # Don't trigger on commits with closed PRs, including merges into `master`.
dependency:
needs: pr
if: ${{ needs.pr.outputs.pr_found == 'true' }}
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
base: ${{ github.ref_name }}
filters: .github/filters.yml
lock:
runs-on: ubuntu-latest
needs: dependency
if: ${{ needs.dependency.outputs.changes == 'true' }}
strategy:
fail-fast: false
matrix:
Expand All @@ -42,12 +59,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 fb4e67d

Please sign in to comment.