Skip to content

Merge pull request #237 from cdepillabout/allow-multiple-wins #278

Merge pull request #237 from cdepillabout/allow-multiple-wins

Merge pull request #237 from cdepillabout/allow-multiple-wins #278

Workflow file for this run

name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]
jobs:
cabal:
name: cabal / ghc-${{ matrix.ghc }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
# Termonad sometimes requires VTE features that are only in recent releases of VTE.
# Older versions of Ubuntu may not have a new enough VTE, so we test on multiple
# versions of Ubuntu (and therefore multiple versions of VTE).
- ubuntu-22.04
- ubuntu-20.04
# - macOS-latest
cabal: ["latest"]
ghc:
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.7"
steps:
- uses: actions/checkout@v3
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v3
name: Cache cabal-store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ matrix.os }}-${{ matrix.ghc }}-cabal
- name: Update apt
run: sudo apt-get update
- name: Install Required System Packages
run: sudo apt-get install gobject-introspection libgirepository1.0-dev libgtk-3-dev libvte-2.91-dev libpcre2-dev
- name: Build
run: |
cabal update
cabal build all --enable-tests --enable-benchmarks --write-ghc-environment-files=always
- name: Test
run: |
cabal test all --enable-tests
stack:
name: stack ${{ matrix.resolver }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
stack: ["latest"]
resolver:
- "--stack-yaml ./stack.yaml" # Stackage LTS
- "--stack-yaml ./stack-nightly.yaml" # Stackage Nightly
os:
# Termonad sometimes requires VTE features that are only in recent releases of VTE.
# Older versions of Ubuntu may not have a new enough VTE, so we test on multiple
# versions of Ubuntu (and therefore multiple versions of VTE).
- ubuntu-22.04
- ubuntu-20.04
# - macOS-latest
steps:
- uses: actions/checkout@v3
#if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
- uses: haskell/actions/setup@v2
name: Setup Haskell Stack
with:
stack-version: ${{ matrix.stack }}
enable-stack: true
- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ matrix.os }}-stack-${{ matrix.resolver }}
- name: Update apt
run: sudo apt-get update
- name: Install Required System Packages
run: sudo apt-get install gobject-introspection libgirepository1.0-dev libgtk-3-dev libvte-2.91-dev libpcre2-dev
- name: Build
run: |
stack ${{ matrix.resolver }} build --test --bench --no-run-tests --no-run-benchmarks --flag termonad:buildexamples
- name: Test
run: |
stack ${{ matrix.resolver }} test --flag termonad:buildexamples
nix:
name: nix / ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix-build
- run: nix-build shell.nix
nix-flakes:
name: nix flakes / ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix build
- run: nix build .#devShell.x86_64-linux
nix-simple-cabal-shell:
name: nix simple cabal shell.nix / ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
# TODO: These caches actually needs to be keyed on the hash of the
# ./nix-helpers/simple-cabal-shell.nix derivation. If that derivation
# changes, then we really, really should not reuse the same
# ~/.cabal/store directory (since there is the possibility of getting
# into a cabal hell, where Haskell libraries in the Cabal store are linked to
# different, incompatible system libraries).
#
# It is possible to get the hash of this derivation with a command like:
#
# $ nix eval --impure --raw --expr 'with (import <nixpkgs> {}).lib; let simpleCabalShell = import ./.nix-helpers/simple-cabal-shell.nix {}; in builtins.elemAt (splitString "-" (removePrefix (builtins.storeDir + "/") simpleCabalShell)) 0'
#
# Just need to load this into a variable, and throw it in the following key name
- uses: actions/cache@v3
name: Cache cabal store
with:
path: |
~/.cabal/store
~/.config/cabal/store
~/.local/state/cabal/store
key: nix-simple-cabal-shell
- name: cabal update
run: nix-shell ./.nix-helpers/simple-cabal-shell.nix --command 'cabal update'
- name: cabal build
run: nix-shell ./.nix-helpers/simple-cabal-shell.nix --command 'cabal build all --enable-tests --enable-benchmarks'