Skip to content

Updates to latest github-actions #14

Updates to latest github-actions

Updates to latest github-actions #14

Workflow file for this run

name: Build and Test
on:
push:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
defaults:
run:
shell: bash
jobs:
find-stack-yamls:
name: Find stack.yamls for GHC Matrix
runs-on: ubuntu-22.04
outputs:
stack-yamls: ${{ steps.set-output.outputs.stack-yamls }}
steps:
- name: Find Stack Yamls
id: set-output
uses: flipstone/github-actions/find-stack-ghc-yamls@3e77b573bad98ae3e316b1b912e21ec83932ca8d
build:
name: Build and Test
needs: find-stack-yamls
runs-on: ubuntu-22.04
strategy:
max-parallel: 5
matrix:
stack-yaml: ${{ fromJson(needs.find-stack-yamls.outputs.stack-yamls) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v4
env:
cache-version: v3
with:
key: ${{ env.cache-version }}-${{ matrix.stack-yaml }}-${{ hashFiles(matrix.stack-yaml, 'stack.yaml', 'package.yaml') }}
restore-keys: |
${{ env.cache-version }}-${{ matrix.stack-yaml }}-
path: |
./stack-root
- name: Setup Stack
uses: flipstone/github-actions/setup-dockerized-stack@3e77b573bad98ae3e316b1b912e21ec83932ca8d
with:
stack-root: ./stack-root
- name: Build and test
run: ./scripts/test --stack-yaml ${{ matrix.stack-yaml }}
cabal-check:
name: Cabal Check
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@3e77b573bad98ae3e316b1b912e21ec83932ca8d
with:
stack-root: ./stack-root
- name: Check for Hackage releasable issues
run: docker compose run --rm dev cabal check
shellcheck:
name: shellcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@3e77b573bad98ae3e316b1b912e21ec83932ca8d
with:
stack-root: ./stack-root
- name: Format and Check for Diff
run: scripts/shellcheck
cabal-latest-build:
name: Cabal Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Stack (for docker env)
uses: flipstone/github-actions/setup-dockerized-stack@3e77b573bad98ae3e316b1b912e21ec83932ca8d
with:
stack-root: ./stack-root
- name: Build with cabal and latest ghc+deps
# When a new ghc version is released, we might not be able to build all the dependencies for
# a little while. So we need to allow failure here. It is a very unfortunate situation that
# github does not give us a better UX for this as the closest thing to a required check is
# not configured here, but seemingly only through the api/webui for "branch protection"
continue-on-error: true
run: scripts/cabal-latest