Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 54 additions & 32 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ on:
- 'master'
schedule:
- cron: 0 0 * * *
workflow_dispatch:
inputs:
nightly:
description: Run with the same settings as a nightly build
type: boolean
default: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -29,6 +35,14 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
if: "${{ github.event_name == 'schedule'
|| contains(github.event.pull_request.title, 'nightly')
|| contains(github.event.pull_request.title, 'NIGHTLY')
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
run: |
echo "NIGHTLY=true" >> $GITHUB_ENV

- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
with:
Expand All @@ -50,40 +64,48 @@ jobs:
name: Stack
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set NIGHTLY environment variable if the job was triggered by the scheduler
if: "${{ github.event_name == 'schedule'
|| contains(github.event.pull_request.title, 'nightly')
|| contains(github.event.pull_request.title, 'NIGHTLY')
|| github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}"
run: |
echo "NIGHTLY=true" >> $GITHUB_ENV

- uses: actions/checkout@v4

- uses: haskell-actions/setup@v2
id: setup-haskell-stack
name: Setup Haskell
with:
enable-stack: true
stack-version: latest
ghc-version: 9.6.7
- uses: haskell-actions/setup@v2
id: setup-haskell-stack
name: Setup Haskell
with:
enable-stack: true
stack-version: latest
ghc-version: 9.6.7

- name: Cache
id: cache
uses: actions/cache@v4
with:
path: |
${{ steps.setup-haskell-stack.outputs.stack-root }}
.stack-work
key: ${{ runner.os }}-stack-${{ github.sha }}
restore-keys: ${{ runner.os }}-stack
- name: Cache
id: cache
uses: actions/cache@v4
with:
path: |
${{ steps.setup-haskell-stack.outputs.stack-root }}
.stack-work
key: ${{ runner.os }}-stack-${{ github.sha }}
restore-keys: ${{ runner.os }}-stack

- name: Test
run: stack test --coverage --flag constrained-generators:dev
- name: Test
run: stack test --coverage --flag constrained-generators:dev

- uses: actions/cache/save@v4
with:
path: |
${{ steps.setup-haskell-stack.outputs.stack-root }}
.stack-work
key: ${{ runner.os }}-stack-${{ github.sha }}
- uses: actions/cache/save@v4
with:
path: |
${{ steps.setup-haskell-stack.outputs.stack-root }}
.stack-work
key: ${{ runner.os }}-stack-${{ github.sha }}

- name: Upload coverage report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
[ -n "${COVERALLS_REPO_TOKEN}" ]
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined all
- name: Upload coverage report
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
[ -n "${COVERALLS_REPO_TOKEN}" ]
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined all