free-algebras-0.1.2.0 #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Haskell CI | |
on: | |
pull_request: | |
push: | |
branches: ['master'] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ["8.10", "9.0", "9.2", "9.4", "9.6", "9.8", "9.10"] | |
os: [ubuntu-latest] | |
steps: | |
- name: Install Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: 3.12.1.0 | |
- name: Select build directory | |
run: | | |
if [ "$RUNNER_OS" == Windows ]; then | |
CABAL_BUILDDIR="D:\\a\\_temp\\dist" | |
else | |
CABAL_BUILDDIR="dist-newstyle" | |
fi | |
echo "CABAL_BUILDDIR=$CABAL_BUILDDIR" | |
echo "CABAL_BUILDDIR=$CABAL_BUILDDIR" >> $GITHUB_ENV | |
- name: Set cache version | |
run: echo "CACHE_VERSION=9w76Z3Q" >> $GITHUB_ENV | |
- name: Set up temp directory | |
env: | |
RUNNER_TEMP: ${{ runner.temp }} | |
run: | | |
echo "TMPDIR=$RUNNER_TEMP" >> $GITHUB_ENV | |
echo "TMP=$RUNNER_TEMP" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
- name: Record dependencies | |
id: record-deps | |
run: | | |
cabal build all --dry-run | |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt | |
- name: Cache `cabal store` | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.setup-haskell.outputs.cabal-store }} | |
key: cabal-store-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
restore-keys: cabal-store-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
- name: Cache `dist-newstyle` | |
uses: actions/cache@v4 | |
with: | |
path: | | |
dist-newstyle | |
!dist-newstyle/**/.git | |
key: cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
- name: Use cabal.project.local | |
run: | | |
cat .github/workflows/cabal.project.local >> ./cabal.project.local | |
cat ./cabal.project.local | |
- name: Build dependencies | |
run: cabal --builddir="$CABAL_BUILDDIR" build --only-dependencies all | |
- name: Build projects [build] | |
run: cabal --builddir="$CABAL_BUILDDIR" build all | |
- name: Run tests | |
run: cabal --builddir="$CABAL_BUILDDIR" run free-algebras:test-free-algebras |