dejafu/.github/workflows/ci.yaml
dependabot[bot] a71bdcc5f9
Bump mstksg/setup-stack from v1 to v2
Bumps [mstksg/setup-stack](https://github.com/mstksg/setup-stack) from v1 to v2.
- [Release notes](https://github.com/mstksg/setup-stack/releases)
- [Commits](https://github.com/mstksg/setup-stack/compare/v1...69e4283faeb7a89f26326daa36e9cc0fa7a023bd)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-20 11:05:35 +00:00

95 lines
2.7 KiB
YAML

name: Run tests
on: pull_request
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 'https://github.com/mstksg/setup-stack/issues/13'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'
- uses: actions/checkout@v2
- uses: mstksg/setup-stack@v2
- name: Setup
run: |
stack --no-terminal install stylish-haskell hlint
- name: Lint
run: |
set -ex
stack --no-terminal exec ./lint.sh
stack --no-terminal exec ./style.sh
git diff --exit-code
doctest:
runs-on: ubuntu-latest
steps:
- name: 'https://github.com/mstksg/setup-stack/issues/13'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'
- uses: actions/checkout@v2
- uses: mstksg/setup-stack@v2
- name: Setup
run: |
set -ex
stack --no-terminal setup
stack --no-terminal install doctest
- name: Build
run: |
stack --no-terminal build
- name: Test
run: |
stack --no-terminal exec -- bash -c "DEJAFU_DOCTEST=y doctest dejafu/Test"
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
resolver:
- lts-9.0 # ghc-8.0
- lts-10.0 # ghc-8.2
- lts-12.0 # ghc-8.4
- lts-13.3 # ghc-8.6
- lts-15.0 # ghc-8.8
- lts-17.0 # ghc-8.10
steps:
- name: 'https://github.com/mstksg/setup-stack/issues/13'
run: 'echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV'
- uses: actions/checkout@v2
- uses: mstksg/setup-stack@v2
- name: Setup
env:
RESOLVER: ${{ matrix.resolver }}
run: |
set -ex
if [[ "$RESOLVER" == "lts-9.0" ]]; then
# need an old stack version to build happy
curl -L https://github.com/commercialhaskell/stack/releases/download/v1.6.1/stack-1.6.1-linux-x86_64.tar.gz | \
tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
# need hedgehog-0.5.2
cat <<EOF > stack.yaml
resolver: lts-9.0
packages:
- concurrency
- dejafu
- dejafu-tests
- hunit-dejafu
- tasty-dejafu
extra-deps:
- hedgehog-0.5.2
EOF
else
stack --no-terminal init --resolver="$RESOLVER" --force
fi
stack --no-terminal setup
- name: Build
run: |
stack --no-terminal build --ghc-options="-Werror -Wno-unused-imports"
- name: Test
run: |
cd dejafu-tests
stack --no-terminal exec -- dejafu-tests +RTS -s