Allow for more flexibility in rebar3 version

This commit is contained in:
Paulo Oliveira 2021-06-18 18:35:19 +01:00
parent e748552809
commit b81fa6f0d6
2 changed files with 16 additions and 5 deletions

View File

@ -5,6 +5,7 @@ _versions: {
// In turn, we can't compile for the newer libsodium functions on this image, // In turn, we can't compile for the newer libsodium functions on this image,
// and it fails. Hence these versions. // and it fails. Hence these versions.
all: ["22.3", "23.3", "24.0"] all: ["22.3", "23.3", "24.0"]
rebar3: "3.16.1"
} }
#Name: string #Name: string
@ -17,9 +18,11 @@ _versions: {
page_build?: #Branches page_build?: #Branches
} }
#Action: "actions/checkout@v2" #Action: "actions/checkout@v2" | "actions/setup-beam@v1"
#Steps: { #Steps: {
uses: #Action uses: #Action
with:
_: string
} | { } | {
name: string name: string
run: string run: string
@ -30,7 +33,6 @@ _versions: {
#Jobs: ci: { #Jobs: ci: {
name: string name: string
"runs-on": string "runs-on": string
container: image: string
strategy: strategy:
matrix: { matrix: {
otp_vsn: [...string] otp_vsn: [...string]
@ -52,7 +54,6 @@ jobs: #Jobs & {
ci: { ci: {
name: "Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}" name: "Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}"
"runs-on": "${{matrix.os}}" "runs-on": "${{matrix.os}}"
container: image: "erlang:${{matrix.otp_vsn}}"
strategy: matrix: { strategy: matrix: {
otp_vsn: _versions.all otp_vsn: _versions.all
// This entry is a lie. The container images are Debian containers, but // This entry is a lie. The container images are Debian containers, but
@ -65,6 +66,13 @@ jobs: #Jobs & {
name: "Update apt-get database" name: "Update apt-get database"
run: "apt-get update" run: "apt-get update"
}, },
{
uses: "actions/setup-beam@v1"
with: {
"otp-version": "${{matrix.otp_vsn}}"
"rebar3-version": _versions.rebar3
}
},
{ {
name: "Install libsodium" name: "Install libsodium"
run: "apt-get install -y libsodium-dev" run: "apt-get install -y libsodium-dev"

View File

@ -10,8 +10,6 @@ jobs:
ci: ci:
name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}} name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
container:
image: erlang:${{matrix.otp_vsn}}
strategy: strategy:
matrix: matrix:
otp_vsn: otp_vsn:
@ -22,8 +20,13 @@ jobs:
- ubuntu-latest - ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: {}
- name: Update apt-get database - name: Update apt-get database
run: apt-get update run: apt-get update
- uses: actions/setup-beam@v1
with:
otp-version: ${{matrix.otp_vsn}}
rebar3-version: 3.16.1
- name: Install libsodium - name: Install libsodium
run: apt-get install -y libsodium-dev run: apt-get install -y libsodium-dev
- name: Compile source code - name: Compile source code