Skip to content

Commit a29d2f1

Browse files
set the NIGHTLY variable in nightly tests
1 parent b24b667 commit a29d2f1

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030

3131
steps:
32+
- name: Set NIGHTLY environment variable if scheduled
33+
if: github.event_name == 'schedule'
34+
run: echo "NIGHTLY=1" >> $GITHUB_ENV
3235
- uses: actions/checkout@v4
3336
- uses: haskell-actions/setup@v2
3437
with:
@@ -50,40 +53,43 @@ jobs:
5053
name: Stack
5154
runs-on: ubuntu-latest
5255
steps:
53-
- uses: actions/checkout@v4
56+
- name: Set NIGHTLY environment variable if scheduled
57+
if: github.event_name == 'schedule'
58+
run: echo "NIGHTLY=1" >> $GITHUB_ENV
59+
- uses: actions/checkout@v4
5460

55-
- uses: haskell-actions/setup@v2
56-
id: setup-haskell-stack
57-
name: Setup Haskell
58-
with:
59-
enable-stack: true
60-
stack-version: latest
61-
ghc-version: 9.6.7
61+
- uses: haskell-actions/setup@v2
62+
id: setup-haskell-stack
63+
name: Setup Haskell
64+
with:
65+
enable-stack: true
66+
stack-version: latest
67+
ghc-version: 9.6.7
6268

63-
- name: Cache
64-
id: cache
65-
uses: actions/cache@v4
66-
with:
67-
path: |
68-
${{ steps.setup-haskell-stack.outputs.stack-root }}
69-
.stack-work
70-
key: ${{ runner.os }}-stack-${{ github.sha }}
71-
restore-keys: ${{ runner.os }}-stack
69+
- name: Cache
70+
id: cache
71+
uses: actions/cache@v4
72+
with:
73+
path: |
74+
${{ steps.setup-haskell-stack.outputs.stack-root }}
75+
.stack-work
76+
key: ${{ runner.os }}-stack-${{ github.sha }}
77+
restore-keys: ${{ runner.os }}-stack
7278

73-
- name: Test
74-
run: stack test --coverage --flag constrained-generators:dev
79+
- name: Test
80+
run: stack test --coverage --flag constrained-generators:dev
7581

76-
- uses: actions/cache/save@v4
77-
with:
78-
path: |
79-
${{ steps.setup-haskell-stack.outputs.stack-root }}
80-
.stack-work
81-
key: ${{ runner.os }}-stack-${{ github.sha }}
82+
- uses: actions/cache/save@v4
83+
with:
84+
path: |
85+
${{ steps.setup-haskell-stack.outputs.stack-root }}
86+
.stack-work
87+
key: ${{ runner.os }}-stack-${{ github.sha }}
8288

83-
- name: Upload coverage report
84-
env:
85-
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
86-
run: |
87-
[ -n "${COVERALLS_REPO_TOKEN}" ]
88-
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc
89-
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined all
89+
- name: Upload coverage report
90+
env:
91+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
92+
run: |
93+
[ -n "${COVERALLS_REPO_TOKEN}" ]
94+
curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.7.0/shc-Linux-X64.tar.bz2 | tar xj shc
95+
./shc --repo-token="$COVERALLS_REPO_TOKEN" --partial-coverage --fetch-coverage combined all

0 commit comments

Comments
 (0)