Use types

This commit is contained in:
Jesper Louis Andersen 2021-06-18 14:32:47 +02:00
parent 8b8fe9fa98
commit 529d8f6033
2 changed files with 61 additions and 29 deletions

View File

@ -1,13 +1,40 @@
let OTP_Versions = { // Versions for simplicity
latest: [24.0] _versions: {
latest: ["24.0"]
// Older versions than 22.3 use Debian stretch, and it only has libsodium 0.18 // Older versions than 22.3 use Debian stretch, and it only has libsodium 0.18
// 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"]
} }
name: "build" #Name: string
on: { #Branches: branches: [string]
#On: {
push: #Branches
pull_request: #Branches
}
#Steps: {
uses: "actions/checkout@v2"
} | {
name: string
run: string
}
#Jobs: ci: {
name: string
"runs-on": string
container: image: string
strategy:
matrix: {
otp_vsn: [string, ...]
os: ["ubuntu-latest"]
}
steps: [#Steps, ...]
}
name: #Name & "build"
on: #On & {
push: branches: [ push: branches: [
"master", "master",
] ]
@ -15,24 +42,29 @@ on: {
"master", "master",
] ]
} }
jobs: ci: { jobs: #Jobs & {
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}}" container: image: "erlang:${{matrix.otp_vsn}}"
strategy: matrix: { strategy: matrix: {
otp_vsn: OTP_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
// one has to specify where those containers are hosted. // one has to specify where those containers are hosted.
os: ["ubuntu-latest"] os: ["ubuntu-latest"]
} }
steps: [ steps: [
{uses: "actions/checkout@v2"}, {uses: "actions/checkout@v2"},
{name: "Update apt-get database", {name: "Update apt-get database"
run: "apt-get update"}, run: "apt-get update"
{name: "Install libsodium", },
run: "apt-get install -y libsodium-dev"}, {name: "Install libsodium"
{name: "Compile source code", run: "apt-get install -y libsodium-dev"
run: "make compile"}, },
{name: "Run the tests", {name: "Compile source code"
run: "make tests"}] run: "make compile"
} },
{name: "Run the tests"
run: "make tests"
}]
}}

View File

@ -15,9 +15,9 @@ jobs:
strategy: strategy:
matrix: matrix:
otp_vsn: otp_vsn:
- 22.3 - "22.3"
- 23.3 - "23.3"
- 24.0 - "24.0"
os: os:
- ubuntu-latest - ubuntu-latest
steps: steps: