From e6039009af04f02d49ebcc9b388c7c8c75516a60 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 17 Mar 2023 15:18:40 +1100 Subject: [PATCH] Add github actions for ghc-8.10 and ghc-9.2 --- .github/workflows/cabal.project.local.ci | 5 ++ .github/workflows/haskell.yml | 59 ++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/cabal.project.local.ci create mode 100644 .github/workflows/haskell.yml diff --git a/.github/workflows/cabal.project.local.ci b/.github/workflows/cabal.project.local.ci new file mode 100644 index 00000000000..415a21c29cb --- /dev/null +++ b/.github/workflows/cabal.project.local.ci @@ -0,0 +1,5 @@ +package cardano-crypto-praos + flags: -external-libsodium-vrf + +package HsOpenSSL + flags: +use-pkg-config diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml new file mode 100644 index 00000000000..7bf70efc2a7 --- /dev/null +++ b/.github/workflows/haskell.yml @@ -0,0 +1,59 @@ +name: CI + +# Trigger the workflow on push or pull request, but only for the master branch +on: + pull_request: + push: + branches: [master] + +jobs: + build: + name: ghc ${{ matrix.ghc }} + runs-on: ubuntu-latest + strategy: + matrix: + ghc: [ "8.10.7", "9.2.4" ] + + steps: + - uses: actions/checkout@v2 + if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' + + - name: Other Packages + run: | + sudo apt update + sudo apt purge aspnetcore* dotnet* firefox powershell + sudo apt upgrade + sudo apt install -y pkg-config libsodium-dev libsecp256k1-dev libsystemd-dev + + - uses: haskell/actions/setup@v1 + name: Setup Haskell + with: + ghc-version: ${{ matrix.ghc }} + + - name: Copy cabal.project.local + shell: bash + run: | + cp .github/workflows/cabal.project.local.ci cabal.project.local + echo "# cabal.project.local" + cat cabal.project.local + + - uses: actions/cache@v2 + name: Cache ~/.cabal/store + with: + path: | + ${{ steps.setup-haskell.outputs.cabal-store }} + dist-newstyle + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}- + + - name: Build + run: | + cabal build all --enable-tests --enable-benchmarks -j + + - name: Test # Run all the tests other than the integration tests which require Nix. + run: | + cabal test --enable-tests -j1 cardano-wallet-primitive:test delta-table:unit dbvar:unit + cabal test --enable-tests -j1 wai-middleware-logging:unit strict-non-empty-containers:unit + cabal test --enable-tests -j1 cardano-wallet-test-utils:unit cardano-numeric:unit cardano-coin-selection:test + cabal test --enable-tests -j1 text-class:unit cardano-balance-tx:test cardano-wallet-launcher:unit