From a29d2f1b91d90ef58e067762a2b69158345a24e7 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Tue, 21 Oct 2025 09:07:41 +0200 Subject: [PATCH 1/3] set the `NIGHTLY` variable in nightly tests --- .github/workflows/haskell-ci.yml | 70 +++++++++++++++++--------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 738d201..2c0567c 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -29,6 +29,9 @@ jobs: runs-on: ${{ matrix.os }} steps: + - name: Set NIGHTLY environment variable if scheduled + if: github.event_name == 'schedule' + run: echo "NIGHTLY=1" >> $GITHUB_ENV - uses: actions/checkout@v4 - uses: haskell-actions/setup@v2 with: @@ -50,40 +53,43 @@ jobs: name: Stack runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Set NIGHTLY environment variable if scheduled + if: github.event_name == 'schedule' + run: echo "NIGHTLY=1" >> $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 From 94f133b810e1fc22b1a37eae3cc439824981c774 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Thu, 23 Oct 2025 08:53:15 +0200 Subject: [PATCH 2/3] Workflow dispatch with the same behaviour as nightly job --- .github/workflows/haskell-ci.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 2c0567c..9d9d9d4 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -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 }} @@ -29,9 +35,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Set NIGHTLY environment variable if scheduled - if: github.event_name == 'schedule' - run: echo "NIGHTLY=1" >> $GITHUB_ENV + - name: Set NIGHTLY environment variable if the job was triggered by the scheduler + if: "${{ github.event_name == 'schedule' + || 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: @@ -53,9 +62,12 @@ jobs: name: Stack runs-on: ubuntu-latest steps: - - name: Set NIGHTLY environment variable if scheduled - if: github.event_name == 'schedule' - run: echo "NIGHTLY=1" >> $GITHUB_ENV + - name: Set NIGHTLY environment variable if the job was triggered by the scheduler + if: "${{ github.event_name == 'schedule' + || github.event_name == 'workflow_dispatch' && github.event.inputs.nightly }}" + run: | + echo "NIGHTLY=true" >> $GITHUB_ENV + - uses: actions/checkout@v4 - uses: haskell-actions/setup@v2 From 1349f517938969635d98e7c56ab0df91d856d612 Mon Sep 17 00:00:00 2001 From: Maximilian Algehed Date: Thu, 23 Oct 2025 08:54:29 +0200 Subject: [PATCH 3/3] also trigger when the PR talks about nightly --- .github/workflows/haskell-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 9d9d9d4..1fdaa76 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -37,6 +37,8 @@ jobs: 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 @@ -64,6 +66,8 @@ jobs: 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