Skip to content

Commit

Permalink
Replace travis CI with github actions (#51)
Browse files Browse the repository at this point in the history
* Use github actions for basic testing

* Remove travis

* Use CPP

* Run tests without fast

* Add more stackage resolvers
  • Loading branch information
psibi authored Jun 22, 2023
1 parent 44e7045 commit cc9b884
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 137 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Tests

on:
pull_request:
push:
branches:
- master

jobs:
build:
name: CI
runs-on: ${{ matrix.os }}
env:
STACK_ROOT: ${{ github.workspace }}/.stack
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
stack-yaml: stack.yaml
resolver: lts-21
- os: macos-latest
stack-yaml: stack.yaml
resolver: lts-21
- os: windows-latest
stack-yaml: stack.yaml
resolver: lts-21
- os: ubuntu-latest
stack-yaml: stack.yaml
resolver: lts-20
- os: macos-latest
stack-yaml: stack.yaml
resolver: lts-20
- os: windows-latest
stack-yaml: stack.yaml
resolver: lts-20
- os: ubuntu-latest
stack-yaml: stack.yaml
resolver: lts-19
- os: macos-latest
stack-yaml: stack.yaml
resolver: lts-19
- os: windows-latest
stack-yaml: stack.yaml
resolver: lts-19

steps:
- name: Clone project
uses: actions/checkout@v2
with:
submodules: 'true'

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.stack
${{ github.workspace }}/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-haskell-${{ hashFiles('stack.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.resolver }}-haskell-
- name: Build and run tests
shell: bash
run: |
set -ex
if [ "$RUNNER_OS" == "Linux" ] || [ "$RUNNER_OS" == "macOS" ]; then
curl -sSL https://get.haskellstack.org/ | sh -s - -f
fi
stack test --no-terminal --stack-yaml=${{ matrix.stack-yaml }} --resolver=${{ matrix.resolver }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
131 changes: 0 additions & 131 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions src/Weigh.hs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ module Weigh
import Control.Applicative
import Control.Arrow
import Control.DeepSeq
#if MIN_VERSION_base(4,18,0)
import Control.Monad (unless)
#endif
import Control.Monad.State
import Criterion.Measurement
import qualified Data.Foldable as Foldable
Expand Down
3 changes: 1 addition & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
resolver: lts-11.3
#resolver: nightly-2017-11-23
resolver: lts-19.33
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
size: 506659
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/11/3.yaml
sha256: 4a02ab9386e5968c58529fdf79707ccd0ae1352c213e28a78ee9e0d836be1824
original: lts-11.3
sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4
size: 619204
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml
original: lts-19.33

0 comments on commit cc9b884

Please sign in to comment.