Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
chshersh committed Apr 30, 2021
1 parent 5b0283e commit af06661
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/ci.yml
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'
Expand All @@ -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
5 changes: 2 additions & 3 deletions hit-on.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ category: Git, CLI Tool
build-type: Simple
extra-doc-files: README.md
CHANGELOG.md
tested-with: GHC == 8.8.4
GHC == 8.10.4
tested-with: GHC == 8.10.4

source-repository head
type: git
location: https://github.com/kowainik/hit-on.git

common common-options
build-depends: base >= 4.13.0.0 && < 4.15
build-depends: base ^>= 4.14
, relude ^>= 0.7.0.0

mixins: base hiding (Prelude)
Expand Down

0 comments on commit af06661

Please sign in to comment.