Skip to content

Commit

Permalink
Automate dependencies repins for Renovate PRs (#14709)
Browse files Browse the repository at this point in the history
Co-authored-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
DineshKumarRA and VietND96 authored Dec 19, 2024
1 parent 825b040 commit 7ee9d16
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
steps:
- name: Checkout source tree
uses: actions/checkout@v4
- name: Pull latest changes
if: startsWith(github.head_ref, 'renovate/')
run: git pull origin ${{ github.head_ref }}
- name: Free space
if: inputs.os != 'windows'
run: ./scripts/github-actions/free-disk-space.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-rbe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
format:
name: Format
if: github.repository_owner == 'seleniumhq'
if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
uses: ./.github/workflows/bazel.yml
with:
name: Check format script run
Expand All @@ -20,7 +20,7 @@ jobs:

test:
name: Test
if: github.repository_owner == 'seleniumhq'
if: github.repository_owner == 'seleniumhq' && startsWith(github.head_ref, 'renovate/') != true
uses: ./.github/workflows/bazel.yml
with:
name: All RBE tests
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/ci-renovate-rbe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI - Renovate - RBE

on:
push:
branches:
- renovate/*
workflow_dispatch:

jobs:
format:
runs-on: ubuntu-latest
if: github.repository_owner == 'seleniumhq'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: java - repin dependencies
if: contains(join(github.event.commits.*.message), '[java]')
run: REPIN=1 bazel run @maven//:pin
- name: rust - repin dependencies
if: contains(join(github.event.commits.*.message), '[rust]')
run: CARGO_BAZEL_REPIN=true bazel sync --only=crates
- name: js - repin dependencies
if: contains(join(github.event.commits.*.message), '[js]')
run: bazel run -- @pnpm//:pnpm install --dir $PWD --lockfile-only
- name: dotnet - repin dependencies
if: contains(join(github.event.commits.*.message), '[dotnet]')
run: ./dotnet/update-deps.sh
- name: py - repin dependencies
if: contains(join(github.event.commits.*.message), '[py]')
run: bazel run //py:requirements.update
- name: Commit files
run: |
export CHANGES=$(git status -s)
if [ -n "$CHANGES" ]; then
git config --local user.email "[email protected]"
git config --local user.name "Selenium CI Bot"
git add .
git commit -m 'Repin dependencies'
git push
fi
check-format:
needs: format
name: Check format
if: github.repository_owner == 'seleniumhq'
uses: ./.github/workflows/bazel.yml
with:
name: Check format script run
caching: false
ruby-version: jruby-9.4.8.0
run: ./scripts/github-actions/check-format.sh

test:
name: Test
if: github.repository_owner == 'seleniumhq'
uses: ./.github/workflows/bazel.yml
with:
name: All RBE tests
caching: false
ruby-version: jruby-9.4.8.0
run: ./scripts/github-actions/ci-build.sh
78 changes: 62 additions & 16 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,82 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"labels": ["dependencies"],
"packageRules": [
{
"matchPackageNames": ["bazel", "bazelisk"],
"commitMessageSuffix": "[dotnet][java][js][py][rb][rust]"
"matchManagers": [ "bazel", "bazel-module", "bazelisk" ],
"matchPackageNames": [ "!rules_java", "!rules_jvm_external", "!contrib_rules_jvm", "!rules_dotnet", "!aspect_rules_js", "!aspect_rules_ts", "!rules_nodejs", "!rules_python", "!rules_ruby", "!rules_cc" ],
"matchDatasources": [ "!maven" ],
"commitMessagePrefix": "[dotnet][java][js][py][rb][rust]",
"labels": [ "dependencies", "c-build" ]
},
{
"matchPackageNames": ["nuget"],
"commitMessagePrefix": "[dotnet]"
"matchManagers": [ "nuget" ],
"commitMessagePrefix": "[dotnet]",
"labels": [ "dependencies", "c-dotnet" ]
},
{
"matchPackageNames": ["maven"],
"commitMessagePrefix": "[java]"
"matchPackageNames": [ "rules_dotnet" ],
"commitMessagePrefix": "[dotnet]",
"labels": [ "dependencies", "c-dotnet" ]
},
{
"matchPackageNames": ["npm"],
"commitMessagePrefix": "[js]"
"matchManagers": [ "bazel", "bazel-module" ],
"matchDatasources": ["maven"],
"versioning": "maven",
"commitMessagePrefix": "[java]",
"labels": [ "dependencies", "c-java" ]
},
{
"matchPackageNames": ["pip_requirements"],
"commitMessagePrefix": "[py]"
"matchManagers": [ "bazel-module" ],
"matchPackageNames": [ "rules_java", "rules_jvm_external", "contrib_rules_jvm" ],
"commitMessagePrefix": "[java]",
"labels": [ "dependencies", "c-java" ]
},
{
"matchPackageNames": ["bundler", "ruby-version"],
"commitMessagePrefix": "[rb]"
"matchManagers": [ "maven" ],
"commitMessagePrefix": "[java]",
"labels": [ "dependencies", "c-java" ]
},
{
"matchPackageNames": ["cargo"],
"commitMessagePrefix": "[rust]"
"matchManagers": [ "npm" ],
"commitMessagePrefix": "[js]",
"labels": [ "dependencies", "c-nodejs" ]
},
{
"matchPackageNames": [ "aspect_rules_js", "aspect_rules_ts", "rules_nodejs" ],
"commitMessagePrefix": "[js]",
"labels": [ "dependencies", "c-nodejs" ]
},
{
"matchManagers": [ "pip_requirements", "pip_setup" ],
"commitMessagePrefix": "[py]",
"labels": [ "dependencies", "c-py" ]
},
{
"matchPackageNames": [ "rules_python" ],
"commitMessagePrefix": "[py]",
"labels": [ "dependencies", "c-py" ]
},
{
"matchManagers": [ "bundler", "ruby-version" ],
"commitMessagePrefix": "[rb]",
"labels": [ "dependencies", "c-rb" ]
},
{
"matchPackageNames": [ "rules_ruby" ],
"commitMessagePrefix": "[rb]",
"labels": [ "dependencies", "c-rb" ]
},
{
"matchManagers": [ "cargo" ],
"commitMessagePrefix": "[rust]",
"labels": [ "dependencies", "c-rust" ]
},
{
"matchPackageNames": [ "rules_cc" ],
"commitMessagePrefix": "[rust]",
"labels": [ "dependencies", "c-rust" ]
}
],
"prConcurrentLimit": 5
"prConcurrentLimit": 10
}

0 comments on commit 7ee9d16

Please sign in to comment.