Skip to content

Commit

Permalink
Use artifacts to pass build results to test jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmayhew committed Apr 25, 2024
1 parent 06fa7ed commit d16d51c
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ jobs:
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
# cache is invalidated upon a change to cabal.project (and/or cabal.project.local), a bump to
# CABAL_CACHE_VERSION or after a week of inactivity
key: cache-${{ runner.os }}-${{ matrix.ghc }}-${{ env.CABAL_CACHE_VERSION }}-${{ hashFiles('cabal.project*') }}
Expand All @@ -103,6 +102,15 @@ jobs:
- name: Build
run: cabal build all

# Pass working directory to test jobs
- name: Save working directory
uses: actions/upload-artifact@v4
with:
name: state-${{ matrix.ghc }}-${{ matrix.os }}
path: .
overwrite: true
retention-days: 1

test:
needs: build

Expand Down Expand Up @@ -158,8 +166,6 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v4

- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
id: setup-haskell
Expand All @@ -182,13 +188,6 @@ jobs:
gem install cddl -v 0.10.3
gem install cbor-diag
- name: Configure to use libsodium
run: |
cat >> cabal.project <<EOF
package cardano-crypto-praos
flags: -external-libsodium-vrf
EOF
- name: Download Mainnet Mirror
run: |
REF=a31ac75
Expand All @@ -212,26 +211,28 @@ jobs:
run: |
echo "NIGHTLY=true" >> $GITHUB_ENV
- name: Cabal update
run: cabal update

- name: Cabal configure
run: cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=always
# Retrieve working directory from build jobs
- name: Fetch working directory
uses: actions/download-artifact@v4
with:
name: state-${{ matrix.ghc }}-${{ matrix.os }}

- uses: actions/cache@v4
if: matrix.os != 'macos-latest'
name: Cache cabal store
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
# cache is invalidated upon a change to cabal.project (and/or cabal.project.local), a bump to
# CABAL_CACHE_VERSION or after a week of inactivity
key: cache-${{ runner.os }}-${{ matrix.ghc }}-${{ env.CABAL_CACHE_VERSION }}-${{ hashFiles('cabal.project*') }}
# Restoring attempts are from current branch then master
restore-keys: |
cache-${{ runner.os }}-${{ matrix.ghc }}-${{ env.CABAL_CACHE_VERSION }}-${{ hashFiles('cabal.project*') }}
- name: Cabal update
run: cabal update

- name: Run tests
run: |
export CARDANO_MAINNET_MIRROR="$(pwd)/epochs"
Expand Down

0 comments on commit d16d51c

Please sign in to comment.