From 529d8f603301e15c5b3cbd3c395d092bf529fc94 Mon Sep 17 00:00:00 2001 From: Jesper Louis Andersen Date: Fri, 18 Jun 2021 14:32:47 +0200 Subject: [PATCH] Use types --- .github/workflows/ci.cue | 84 +++++++++++++++++++++++++++------------ .github/workflows/ci.yaml | 6 +-- 2 files changed, 61 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.cue b/.github/workflows/ci.cue index 0e65c1b..f214a53 100644 --- a/.github/workflows/ci.cue +++ b/.github/workflows/ci.cue @@ -1,13 +1,40 @@ -let OTP_Versions = { - latest: [24.0] +// Versions for simplicity +_versions: { + latest: ["24.0"] // 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, // and it fails. Hence these versions. - all: [22.3, 23.3, 24.0] + all: ["22.3", "23.3", "24.0"] } -name: "build" -on: { +#Name: string +#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: [ "master", ] @@ -15,24 +42,29 @@ on: { "master", ] } -jobs: ci: { - name: "Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}" - "runs-on": "${{matrix.os}}" - container: image: "erlang:${{matrix.otp_vsn}}" - strategy: matrix: { - otp_vsn: OTP_Versions.all - // This entry is a lie. The container images are Debian containers, but - // one has to specify where those containers are hosted. - os: ["ubuntu-latest"] - } - steps: [ - {uses: "actions/checkout@v2"}, - {name: "Update apt-get database", - run: "apt-get update"}, - {name: "Install libsodium", - run: "apt-get install -y libsodium-dev"}, - {name: "Compile source code", - run: "make compile"}, - {name: "Run the tests", - run: "make tests"}] -} +jobs: #Jobs & { + ci: { + name: "Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}}" + "runs-on": "${{matrix.os}}" + container: image: "erlang:${{matrix.otp_vsn}}" + strategy: matrix: { + otp_vsn: _versions.all + // This entry is a lie. The container images are Debian containers, but + // one has to specify where those containers are hosted. + os: ["ubuntu-latest"] + } + steps: [ + {uses: "actions/checkout@v2"}, + {name: "Update apt-get database" + run: "apt-get update" + }, + {name: "Install libsodium" + run: "apt-get install -y libsodium-dev" + }, + {name: "Compile source code" + run: "make compile" + }, + {name: "Run the tests" + run: "make tests" + }] + }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fe87f85..268479c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,9 +15,9 @@ jobs: strategy: matrix: otp_vsn: - - 22.3 - - 23.3 - - 24.0 + - "22.3" + - "23.3" + - "24.0" os: - ubuntu-latest steps: