Some versions of stylish-haskell do need the ghc-lib flag #4311
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: Flags | |
defaults: | |
run: | |
shell: bash | |
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency. | |
concurrency: | |
group: ${{ github.head_ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
pre_job: | |
runs-on: ubuntu-latest | |
outputs: | |
ghcs: ${{ steps.ghcs.outputs.ghcs }} | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
# Need the repo checked out in order to read the file | |
- uses: actions/checkout@v3 | |
- id: ghcs | |
run: echo "ghcs=$(cat ./.github/workflows/supported-ghc-versions.json)" >> $GITHUB_OUTPUT | |
- id: skip_check | |
uses: fkirc/[email protected] | |
with: | |
cancel_others: false | |
paths_ignore: '[ "**/docs/**" | |
, "**.md" | |
, "**/LICENSE" | |
, "**.nix" | |
, "flake.lock" | |
, "**/README.md" | |
, "FUNDING.yml" | |
, ".circleci/**" | |
, "**/stack*.yaml" | |
, ".gitlab-ci.yaml" | |
, ".gitlab/**" | |
]' | |
flags: | |
if: needs.pre_job.outputs.should_skip != 'true' | |
needs: pre_job | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
ghc: ${{ fromJSON(needs.pre_job.outputs.ghcs) }} | |
os: | |
- ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# By default, the `pull_request` event has a `GITHUB_SHA` env variable | |
# set to the "last merge commit on the GITHUB_REF branch" (see | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request). | |
# But we want to check out the latest commit on the branch whether or | |
# not it is a merge commit, so this is how we do that. | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- uses: ./.github/actions/setup-build | |
with: | |
ghc: ${{ matrix.ghc }} | |
os: ${{ runner.os }} | |
- name: Build `hls-graph` with flags | |
run: cabal v2-build hls-graph --flags="embed-files stm-stats" | |
- name: Build `ghcide` with flags | |
run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe ekg" | |
# wingman fails with flags on 9.0, so this can be removed when that's gone | |
- if: matrix.ghc != '9.0' | |
name: Build with pedantic (-WError) | |
run: cabal v2-build --flags="pedantic" | |
flags_post_job: | |
if: always() | |
runs-on: ubuntu-latest | |
needs: [pre_job, flags] | |
steps: | |
- run: | | |
echo "jobs info: ${{ toJSON(needs) }}" | |
- if: contains(needs.*.result, 'failure') | |
run: exit 1 | |
- if: contains(needs.*.result, 'cancelled') && needs.pre_job.outputs.should_skip != 'true' | |
run: exit 1 |