Skip to content

Try and set-up an armv7 job #451

Try and set-up an armv7 job

Try and set-up an armv7 job #451

name: libsodium-bindings
# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
push:
branches: ["main"]
jobs:
generateMatrix:
name: "Generate matrix from cabal"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Extract the tested GHC versions
id: set-matrix
uses: kleidukos/[email protected]
with:
cabal-file: libsodium-bindings/libsodium-bindings.cabal
ubuntu: true
macos: true
version: 0.1.6.0
tests:
name: ${{ matrix.ghc }} on ${{ matrix.os }}
needs: generateMatrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
steps:
- name: Checkout base repo
uses: actions/checkout@v4
- name: Set up Haskell
id: setup-haskell
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- name: Configure
run: |
./.github/workflows/install-libsodium.sh
- name: Cache
uses: actions/cache@v4
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-x86_64-${{ matrix.ghc }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ runner.os }}-ghc-x86_64-${{ matrix.ghc }}
- name: Build
run: cabal build libsodium-bindings
armv7:
runs-on: ubuntu-latest
name: ${{ matrix.ghc }} on ARMv7
needs: generateMatrix
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
cpu: cortex-a8
commands: |
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
ghcup install ghc ${{ matrix.ghc }}
ghcup set ghc ${{ matrix.ghc }}
./.github/workflows/install-libsodium.sh
cabal build libsodium-bindings