Remove pull array index (unsafe), add uncons. #640
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: Continuous integration | |
on: [push, pull_request] | |
env: | |
# Bump this number to invalidate the Github-actions cache | |
cache-invalidation-key: 0 | |
nixpkgs-url: https://github.com/NixOS/nixpkgs/archive/b2737d4980a17cc2b7d600d7d0b32fd7333aca88.tar.gz | |
jobs: | |
cabal-test: | |
name: cabal test - GHC ${{ matrix.ghc-version }} | |
strategy: | |
matrix: | |
ghc-version: [944, 961] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v15 | |
with: | |
nix_path: "${{ env.nixpkgs-url }}" | |
- name: Cache Cabal dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cabal/packages | |
~/.cabal/store | |
dist-newstyle | |
key: cabal-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}-${{ github.sha }} | |
restore-keys: cabal-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-${{ matrix.ghc-version }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('linear-base.cabal') }}- | |
- name: Build Nix dependencies | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "echo '=== Nix dependencies installed ==='" | |
- name: Init Cabal's config file | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "cabal --config-file=/home/runner/.cabal/config user-config -f init" | |
- name: Update Cabal's database | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "cabal update" | |
- name: Build Cabal's dependencies | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "cabal build --allow-newer --disable-tests --disable-benchmarks --dependencies-only" | |
- name: Build | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "cabal build --allow-newer --disable-tests --disable-benchmarks" | |
- name: Haddock | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run "cabal --allow-newer haddock" | |
- name: cabal-docspec | |
run: nix-shell --arg ghcVersion '"${{ matrix.ghc-version }}"' --pure --run cabal-docspec | |
ormolu: | |
name: check formatting with ormolu | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v15 | |
with: | |
nix_path: "${{ env.nixpkgs-url }}" | |
- name: Cache Stack dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.stack | |
key: stack-deps-ormolu-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock') }}-${{ github.sha }} | |
restore-keys: stack-deps-ormolu-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock') }}- | |
- name: Build Nix dependencies | |
run: nix-shell --pure --run "echo '=== Nix dependencies installed ==='" | |
- name: check formatting | |
run: nix-shell --pure --run 'stack build ormolu && stack exec ormolu -- -m check $(find . -type f -name "*.hs-boot" -o -name "*.hs")' | |
stack-build: | |
name: stack build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: cachix/install-nix-action@v15 | |
with: | |
nix_path: "${{ env.nixpkgs-url }}" | |
- name: Cache Stack dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.stack | |
key: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}-${{ github.sha }} | |
restore-keys: stack-deps-${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-v${{ env.cache-invalidation-key }}-${{ hashFiles('stack.yaml.lock', 'linear-base.cabal') }}- | |
- name: Build Nix dependencies | |
run: nix-shell --pure --run "echo '=== Nix dependencies installed ==='" | |
- name: Build | |
run: nix-shell --pure --run "stack build --pedantic --test --bench --no-run-benchmarks" |