Avoid -Wunused-imports warning with base-4.20
(GHC 9.10)
#317
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: Build and Test | |
on: | |
- push | |
- pull_request | |
jobs: | |
linux: | |
name: Testing ${{ matrix.os }} GHC-${{ matrix.ghc }} | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.allow-failure }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
ghc: [9.10.1, 9.8.1, 9.6.1, 9.4.5, 9.2.2, 9.0.2, 8.10.7, 8.8.4, 8.6.5] | |
allow-failure: [false] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: haskell/actions/setup@v1 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
- name: Install Nix | |
uses: cachix/install-nix-action@v16 | |
with: | |
nix_path: nixpkgs=channel:nixos-21.11 | |
install_url: https://releases.nixos.org/nix/nix-2.11.0/install | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/cache/restore@v3 | |
name: Restore cabal store cache | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
key: | | |
cabal-${{ runner.os }}-ghc${{ matrix.ghc }}-${{ github.ref }} | |
restore-keys: | | |
cabal-${{ runner.os }}-ghc${{ matrix.ghc }}- | |
- name: Cabal update | |
shell: bash | |
run: cabal update | |
- name: Setup Environment Vars | |
# Setup a nix shell environment command that will supply the | |
# appropriate GHC version | |
run: | | |
GHC=haskell.compiler.ghc$(echo ${{ matrix.ghc }} | sed -e s,\\.,,g) | |
echo GHC=$GHC >> $GITHUB_ENV | |
case ${{ matrix.ghc }} in | |
8.6.5) GHC_NIXPKGS=github:nixos/nixpkgs/20.09 ;; | |
9.0.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-22.05 ;; | |
9.2.2) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-22.05 ;; | |
9.4.5) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-23.05 ;; | |
9.6.1) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-23.05 ;; | |
9.8.1) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-23.11 ;; | |
9.10.1) GHC_NIXPKGS=github:nixos/nixpkgs/nixos-24.05 ;; | |
*) GHC_NIXPKGS=github:nixos/nixpkgs/21.11 ;; | |
esac | |
echo NS="nix shell ${GHC_NIXPKGS}#${GHC}" >> $GITHUB_ENV | |
- name: Package's Cabal/GHC compatibility | |
shell: bash | |
# Using setup will use the cabal library installed with GHC | |
# instead of the cabal library of the Cabal-install tool to | |
# verify the cabal file is compatible with the associated | |
# GHC cabal library version. Cannot run "configure" or "build", | |
# because dependencies aren't present, but a "clean" is | |
# sufficient to cause parsing/validation of the cabal file. | |
run: | | |
defsetup() { echo import Distribution.Simple; echo main = defaultMain; } | |
setup_src() { if [ ! -f Setup.hs ] ; then defsetup > DefSetup.hs; fi; ls *Setup.hs; } | |
setup_bin() { echo setup.${{ matrix.ghc }}; } | |
with_ghc() { $NS -c ${@}; } | |
echo "github.com=${{ secrets.GITHUB_TOKEN }}" >> nix.conf | |
with_ghc ghc -o $(setup_bin) $(setup_src) && ./$(setup_bin) clean | |
- name: Cabal check | |
shell: bash | |
run: cabal check | |
- name: Configure | |
shell: bash | |
run: cabal configure --enable-tests | |
- name: Build | |
shell: bash | |
run: cabal build | |
- name: Test | |
shell: bash | |
run: cabal test | |
- name: Documentation | |
shell: bash | |
run: cabal haddock | |
- uses: actions/cache/save@v3 | |
name: Save cabal store cache | |
if: always() | |
with: | |
path: | | |
${{ steps.setup-haskell.outputs.cabal-store }} | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
key: | | |
cabal-${{ runner.os }}-ghc${{ matrix.ghc }}-${{ github.ref }} |