Skip to content

Commit

Permalink
Allow Renovate to run Earthly
Browse files Browse the repository at this point in the history
Actually install it in the Renovate container, not the runner
environment.

Also, run make rather than earthly on release branches.

Signed-off-by: Nic Cope <nicc@rk0n.org>
  • Loading branch information
negz committed May 30, 2024
1 parent 237bf40 commit d3c908a
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .github/renovate-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

curl -fsSLo /usr/local/bin/earthly https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly
chmod +x /usr/local/bin/earthly
/usr/local/bin/earthly bootstrap

runuser -u ubuntu renovate
49 changes: 40 additions & 9 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@
// be at the beginning, high priority at the end
"packageRules": [
{
"description": "Generate code after upgrading go dependencies",
"description": "Generate code after upgrading go dependencies (master)",
"matchDatasources": [
"go"
],
// Currently we only have an Earthfile on master.
matchBaseBranches: ["master"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
Expand All @@ -115,10 +117,30 @@
},
},
{
"description": "Lint code after upgrading golangci-lint",
"description": "Generate code after upgrading go dependencies (release branch)",
"matchDatasources": [
"go"
],
// Currently we only have an Earthfile on master.
matchBaseBranches: ["release-.+"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
"make go.generate",
],
fileFilters: [
"**/*"
],
executionMode: "update",
},
},
{
"description": "Lint code after upgrading golangci-lint (master)",
"matchDepNames": [
"golangci/golangci-lint"
],
// Currently we only have an Earthfile on master.
matchBaseBranches: ["master"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
Expand All @@ -131,13 +153,22 @@
},
},
{
"matchManagers": [
"crossplane"
],
"matchFileNames": [
"test/e2e/**"
"description": "Lint code after upgrading golangci-lint (release branch)",
"matchDepNames": [
"golangci/golangci-lint"
],
"groupName": "e2e-manifests",
// Currently we only have an Earthfile on master.
matchBaseBranches: ["release-.+"],
postUpgradeTasks: {
// Post-upgrade tasks that are executed before a commit is made by Renovate.
"commands": [
"make go.lint",
],
fileFilters: [
"**/*"
],
executionMode: "update",
},
},
{
"description": "Ignore non-security related updates to release branches",
Expand Down Expand Up @@ -220,4 +251,4 @@
"groupName": "golang version",
}
],
}
}
9 changes: 3 additions & 6 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ jobs:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- name: Setup Earthly
uses: earthly/actions-setup@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.EARTHLY_VERSION }}

# Don't waste time starting Renovate if JSON is invalid
- name: Validate Renovate JSON
run: npx --yes --package renovate -- renovate-config-validator
Expand All @@ -55,3 +49,6 @@ jobs:
with:
configurationFile: .github/renovate.json5
token: '${{ steps.get-github-app-token.outputs.token }}'
mount-docker-socket: true
docker-user: root
docker-cmd-file: .github/renovate-entrypoint.sh

0 comments on commit d3c908a

Please sign in to comment.