-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
21 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,56 @@ | ||
name: CI | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [synchronize, opened, reopened] | ||
push: | ||
branches: [main] | ||
schedule: | ||
# additionally run once per week (At 00:00 on Sunday) to maintain cache | ||
- cron: '0 0 * * 0' | ||
|
||
jobs: | ||
build: | ||
cabal: | ||
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
cabal: ["3.4"] | ||
ghc: ["8.10.4"] | ||
ghc: | ||
- "8.10.4" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main' | ||
|
||
- name: Setup Haskell | ||
uses: actions/[email protected] | ||
- uses: haskell/actions/setup@v1 | ||
id: setup-haskell-cabal | ||
name: Setup Haskell | ||
with: | ||
ghc-version: ${{ matrix.ghc }} | ||
cabal-version: ${{ matrix.cabal }} | ||
|
||
- name: Configure | ||
run: | | ||
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct --write-ghc-environment-files=always | ||
- name: Freeze | ||
run: cabal freeze | ||
run: | | ||
cabal freeze | ||
- name: Cache ~/.cabal/store | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
name: Cache ~/.cabal/store | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
cabal build all --only-dependencies | ||
- name: Build | ||
run: | | ||
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct | ||
cabal build --enable-tests --enable-benchmarks | ||
cabal build all | ||
- name: origin/HEAD | ||
if: matrix.os != 'macOS-latest' | ||
|
@@ -58,17 +67,22 @@ jobs: | |
if: matrix.os != 'macOS-latest' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: cabal test | ||
run: | | ||
cabal test | ||
hlint: | ||
name: hlint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main' | ||
|
||
- name: Run HLint | ||
env: | ||
HLINT_VERSION: "3.2.7" | ||
run: | | ||
curl https://raw.githubusercontent.com/kowainik/relude/v0.7.0.0/.hlint.yaml -o .hlint-relude.yaml | ||
curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s src/ test/ -h .hlint-relude.yaml | ||
curl -L https://github.com/ndmitchell/hlint/releases/download/v${HLINT_VERSION}/hlint-${HLINT_VERSION}-x86_64-linux.tar.gz --output hlint.tar.gz | ||
tar -xvf hlint.tar.gz | ||
./hlint-${HLINT_VERSION}/hlint src/ test/ -h .hlint-relude.yaml |
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