Skip to content

Commit

Permalink
Ease dependency management via Renovate (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira authored Jun 6, 2024
1 parent 95610d5 commit 15f869c
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 87 deletions.
50 changes: 50 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices"
],
"packageRules": [
{
"matchFileNames": [
".github/**/*.yml",
".tool-versions"
],
"groupName": "dev tools"
},
{
"matchFileNames": [
"rebar.config"
],
"groupName": "rebar.config deps"
},
{
"matchPackagePrefixes": [
"minimum_otp_vsn"
],
"enabled": false
}
],
"customManagers": [
{
"description": "Match versions (per datasource and depName) in .github/**/*.yml",
"customType": "regex",
"fileMatch": [
".github/.*/.*\\.yml"
],
"matchStrings": [
"# renovate datasource: (?<datasource>[^,]+), depName: (?<depName>[^\\n]+)\\n[^\\d]+(?<currentValue>v?\\d+(\\.\\d+)?(\\.\\d+)?)"
]
},
{
"description": "Match versions in rebar.config",
"customType": "regex",
"fileMatch": [
"rebar.config"
],
"datasourceTemplate": "hex",
"matchStrings": [
"\\{(?<depName>[^,]+), \"(?<currentValue>\\d+(\\.\\d+)?(\\.\\d+)?)\"\\}"
]
}
]
}
48 changes: 32 additions & 16 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,61 @@ name: Erlang CI
"on": [push, workflow_dispatch]

jobs:
vsns:
runs-on: ubuntu-22.04
outputs:
# renovate datasource: github-runners, depName: ubuntu
ubuntu: 20.04
# renovate datasource: github-runners, depName: windows
windows: 2019
# renovate datasource: github-runners, depName: macos
macos: 12
# renovate datasource: github-tags, depName: erlang/rebar3
rebar3: 3.22.1

steps:
- run: echo "versions set!"

ci:
name: Erlang CI
needs: [vsns]

strategy:
fail-fast: false
matrix:
include:
- os-base: ubuntu
os-vsn: 22.04
os-vsn: ${{ needs.vsns.outputs.ubuntu }}
otp-version: 25
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}
- os-base: ubuntu
os-vsn: 22.04
os-vsn: ${{ needs.vsns.outputs.ubuntu }}
otp-version: 26
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}
- os-base: windows
os-vsn: 2022
os-vsn: ${{ needs.vsns.outputs.windows }}
otp-version: 25
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}
- os-base: windows
os-vsn: 2022
os-vsn: ${{ needs.vsns.outputs.windows }}
otp-version: 26
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}
# macos, for now, is considered best-effort
- os-base: macos
os-vsn: 12
os-vsn: ${{ needs.vsns.outputs.macos }}
otp-version: 25
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}
- os-base: macos # macos, for now, is considered best-effort
os-vsn: 12
os-vsn: ${{ needs.vsns.outputs.macos }}
otp-version: 26
rebar3-version: 3.22
rebar3-version: ${{ needs.vsns.outputs.rebar3 }}

runs-on: ${{matrix.os-base}}-${{matrix.os-vsn}}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4.1.6

- uses: erlef/setup-beam@v1
- uses: erlef/setup-beam@v1.17.5
id: setup-beam
with:
otp-version: ${{matrix.otp-version}}
Expand All @@ -55,7 +71,7 @@ jobs:
if: ${{matrix.os-base == 'macos'}}
- name: Restore _build
uses: actions/cache@v3
uses: actions/cache@v4.0.2
with:
path: _build
key: "_build-cache-for\
Expand All @@ -66,7 +82,7 @@ jobs:
if: ${{matrix.os-base != 'macos'}}

- name: Restore rebar3's cache
uses: actions/cache@v3
uses: actions/cache@v4.0.2
with:
path: ~/.cache/rebar3
key: "rebar3-cache-for\
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.1.6

# uses .markdownlint.yml for configuration
- name: markdownlint
uses: DavidAnson/markdownlint-cli2-action@v13
uses: DavidAnson/markdownlint-cli2-action@v16.0.0
with:
globs: |
.github/**/*.md
*.md
LICENSE
- name: yamllint
uses: ibiqlik/action-yamllint@v3
uses: ibiqlik/action-yamllint@v3.1.1
with:
file_or_dir: |
.github/**/*.yml
Expand All @@ -31,6 +31,6 @@ jobs:
config_file: .yamllint.yml

- name: actionlint
uses: reviewdog/action-actionlint@v1
uses: reviewdog/action-actionlint@v1.48.0
env:
SHELLCHECK_OPTS: -o all
30 changes: 30 additions & 0 deletions .github/workflows/rebar3-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Update dependencies

"on": [push, workflow_dispatch]

jobs:
update:
name: Update rebar.lock
if: "${{ github.ref == 'refs/heads/renovate/rebar.config-deps' }}"
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]

- uses: erlef/[email protected]
with:
version-type: strict
version-file: .tool-versions

- run: |
rebar3 upgrade --all
if ! git diff --exit-code >/dev/null; then
# there's stuff to push
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add rebar.lock
git commit -m "[automation] update \`rebar.lock\` after Renovate"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 0 additions & 35 deletions .github/workflows/rebar3_depup.sh

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/rebar3_depup.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
erlang 25.3.2.5
erlang 25.3.2
rebar 3.22.1
2 changes: 2 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ extends: default
rules:
line-length:
max: 100
comments:
min-spaces-from-content: 1
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{rebar3_lint, "3.2.5"}
]}.

{deps, [{tls_certificate_check, "1.22.1"}]}.
{deps, [{tls_certificate_check, "1.22.0"}]}.

{alias, [{ci, [fmt, hank, lint, xref, dialyzer, ct, cover, ex_doc]}]}.

Expand Down
6 changes: 3 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{"1.2.0",
[{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.7">>},1},
{<<"tls_certificate_check">>,
{pkg,<<"tls_certificate_check">>,<<"1.22.1">>},
{pkg,<<"tls_certificate_check">>,<<"1.22.0">>},
0}]}.
[
{pkg_hash,[
{<<"ssl_verify_fun">>, <<"354C321CF377240C7B8716899E182CE4890C5938111A1296ADD3EC74CF1715DF">>},
{<<"tls_certificate_check">>, <<"0F450CC1568A67A65CE5E15DF53C53F9A098C3DA081C5F126199A72505858DC1">>}]},
{<<"tls_certificate_check">>, <<"6C2E1310C0C8132584229F0B9BB8744A9BFC3F910375C1A4D76B8CC44BB8D893">>}]},
{pkg_hash_ext,[
{<<"ssl_verify_fun">>, <<"FE4C190E8F37401D30167C8C405EDA19469F34577987C76DDE613E838BBC67F8">>},
{<<"tls_certificate_check">>, <<"3092BE0BABDC0E14C2E900542351E066C0FA5A9CF4B3597559AD1E67F07938C0">>}]}
{<<"tls_certificate_check">>, <<"E94F2129866EA7E8879AF462BADCB21F9BEF87159F05AE7840DA5A1986F5F6BB">>}]}
].
6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

0 comments on commit 15f869c

Please sign in to comment.