Skip to content

Commit 9ed5dab

Browse files
committed
Update CI worfklow
1 parent c0ddc43 commit 9ed5dab

1 file changed

Lines changed: 28 additions & 12 deletions

File tree

.github/workflows/linux.yaml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Linux CI
22

33
on:
44
push:
5-
branches: [ master, release, gh-actions ]
5+
branches: [ master, gh-actions ]
66
pull_request:
7-
branches: [ master, release ]
7+
branches: [ master ]
88
schedule:
99
- cron: '13 9 * * *'
1010

@@ -15,11 +15,10 @@ jobs:
1515
strategy:
1616
matrix:
1717
cabal: ["3.4"]
18-
ghc: ["8.10.7"]
18+
ghc: ["8.10"]
1919
os: [ubuntu-latest]
2020

2121
env:
22-
CAIDE_EXE_RELATIVE_PATH: dist-newstyle/build/x86_64-linux/ghc-${{ matrix.ghc }}/libcaide-2.10.0/build/caide/caide
2322
CAIDE_CMAKE_CONFIGURE_ARGS: "-GNinja,-DCMAKE_CXX_COMPILER_LAUNCHER=ccache,-DCMAKE_C_COMPILER_LAUNCHER=ccache"
2423
# TODO: --enable-coverage (https://github.com/haskell/cabal/issues/6440)
2524
CONFIG: "--enable-tests --enable-benchmarks"
@@ -45,12 +44,23 @@ jobs:
4544
with:
4645
submodules: 'recursive'
4746

48-
- uses: haskell/actions/setup@v1
47+
- uses: haskell/actions/setup@v2
4948
id: setup-haskell-cabal
5049
with:
5150
ghc-version: ${{ matrix.ghc }}
5251
cabal-version: ${{ matrix.cabal }}
5352

53+
- name: Set environment variables
54+
run: |
55+
ghc --version | grep -E --only-matching '[0-9\.]+' \
56+
| awk '{ print "GHCVER="$0 }' >> $GITHUB_ENV
57+
58+
- name: Set environment variables
59+
run: |
60+
grep -i '^version:' "libcaide/libcaide.cabal" \
61+
| awk '{ print "CAIDE_EXE_RELATIVE_PATH=dist-newstyle/build/x86_64-linux/ghc-${{ env.GHCVER }}/libcaide-"$2"/build/caide/caide" }' \
62+
>> $GITHUB_ENV
63+
5464
- name: Create key for ccache
5565
shell: bash
5666
run: |
@@ -99,9 +109,9 @@ jobs:
99109
path: |
100110
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
101111
libcaide/dist-newstyle
102-
key: ${{ runner.os }}-${{ env.cache-name }}${{ env.cache-version }}-${{ matrix.ghc }}-${{ hashFiles('libcaide/cabal.project.freeze') }}
112+
key: ${{ runner.os }}-${{ env.cache-name }}${{ env.cache-version }}-${{ env.GHCVER }}-${{ hashFiles('libcaide/cabal.project.freeze') }}
103113
restore-keys: |
104-
${{ runner.os }}-${{ env.cache-name }}${{ env.cache-version }}-${{ matrix.ghc }}-
114+
${{ runner.os }}-${{ env.cache-name }}${{ env.cache-version }}-${{ env.GHCVER }}-
105115
106116
- name: Install dependencies
107117
shell: bash
@@ -126,11 +136,17 @@ jobs:
126136
name: caide
127137
path: libcaide/${{ env.CAIDE_EXE_RELATIVE_PATH }}
128138

129-
- name: HLint
130-
shell: bash
131-
run: |
132-
cd libcaide
133-
curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s . || true
139+
- name: Set up HLint
140+
uses: haskell/actions/hlint-setup@v2
141+
142+
- name: Copy HLint config
143+
run: cp libcaide/.hlint.yaml .
144+
145+
- name: Run HLint
146+
uses: haskell/actions/hlint-run@v2
147+
with:
148+
path: libcaide/
149+
fail-on: never
134150

135151
- name: Run tests
136152
shell: bash

0 commit comments

Comments
 (0)