Install GHC from pkgs.haskell #190
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
# The present workflow was made based on the following references: | |
# - https://github.com/actions/cache/blob/main/examples.md#haskell---cabal | |
# - https://github.com/haskell/time/blob/master/.github/workflows/ci.yml | |
# - https://github.com/stackbuilders/stache/blob/master/.github/workflows/ci.yaml | |
# - https://markkarpov.com/post/github-actions-for-haskell-ci.html | |
--- | |
name: Build | |
on: push | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
haskell: | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- macos-13 # x64 | |
# - ubuntu-latest | |
devShell: | |
# - ghc810 | |
- ghc90 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
# https://input-output-hk.github.io/haskell.nix/tutorials/getting-started.html | |
with: | |
extra_nix_config: | | |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | |
substituters = https://cache.iog.io https://cache.nixos.org | |
# https://github.com/actions/cache/blob/main/examples.md#haskell---cabal | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
key: ${{ runner.os }}-${{ matrix.devShell }}-${{ hashFiles('*.cabal') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.devShell }}- | |
- name: Uninstall GHCup | |
run: ghcup nuke | |
if: ${{ runner.os == 'Linux' }} | |
- name: Install packages / Print versions | |
run: | | |
./bin/${{ matrix.devShell }} -c ghc --version | |
./bin/${{ matrix.devShell }} -c cabal --version | |
timeout-minutes: 5 | |
- name: Update package index | |
run: ./bin/${{ matrix.devShell }} -c cabal update | |
- name: Enable tests | |
run: ./bin/${{ matrix.devShell }} -c cabal configure --enable-tests | |
- name: Install project dependencies | |
run: ./bin/${{ matrix.devShell }} -c cabal build --only-dependencies | |
- name: Compile project | |
run: ./bin/${{ matrix.devShell }} -c cabal build | |
- name: Run tests | |
run: ./bin/${{ matrix.devShell }} -c cabal test | |
- name: Check documentation | |
run: ./bin/${{ matrix.devShell }} -c ./script/haddock | |
docker: | |
uses: ./.github/workflows/reusable-docker.yml | |
with: | |
push: false |