Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulo-ferraz-oliveira committed Jun 6, 2024
1 parent 95610d5 commit 5110f11
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 82 deletions.
44 changes: 44 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$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"
}
],
"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: 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-latest
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.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
erlang 25.3.2.5
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
6 changes: 0 additions & 6 deletions renovate.json

This file was deleted.

0 comments on commit 5110f11

Please sign in to comment.