From ffce9c1c87eef8912900e8c18af69f662bb76aa6 Mon Sep 17 00:00:00 2001 From: Alexis King Date: Fri, 7 Jan 2022 14:10:03 -0600 Subject: [PATCH] Switch to GitHub Actions for CI --- .github/workflows/build.yml | 30 +++++++++++++++++++ .travis.yml | 58 ------------------------------------- cabal.project | 7 ----- cabal.project.ci | 5 ++++ freer-simple.cabal | 8 ++--- 5 files changed, 39 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml create mode 100644 cabal.project.ci diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..eb77ba7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: build +on: [push] +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ghc: ['8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.1'] + name: Build with GHC ${{ matrix.ghc }} + steps: + - uses: actions/checkout@v2 + - name: Setup Haskell + uses: haskell/actions/setup@v1 + with: + ghc-version: ${{ matrix.ghc }} + + - run: cp cabal.project.ci cabal.project.local + - run: cabal v2-update + - run: cabal v2-freeze + - uses: actions/cache@v2 + with: + path: ~/.cabal/store + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}- + + - run: cabal v2-build + - run: cabal v2-test + - run: cabal v2-sdist diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7180ce5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -language: c - -cache: - directories: - - $HOME/.stack - -# The different configurations we want to test. -# -# We set the compiler values here to tell Travis to use a different -# cache file per set of arguments. -matrix: - include: - - env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-7" - compiler: ": #stack 8.0.1" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-8" - compiler: ": #stack 8.0.2" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-10" - compiler: ": #stack 8.2.1" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-11" - compiler: ": #stack 8.2.2" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--stack-yaml=stack.ghc-8.4.yaml --resolver lts-12" - compiler: ": #stack 8.4.4" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--resolver lts-14" - compiler: ": #stack 8.6.5" - addons: { apt: { packages: [libgmp-dev] } } - - - env: ARGS="--stack-yaml=stack.ghc-8.8.yaml --resolver nightly" - compiler: ": #stack nightly" - addons: { apt: { packages: [libgmp-dev] } } - - allow_failures: - # Nightly builds are allowed to fail - - env: ARGS="--stack-yaml=stack.ghc-8.8.yaml --resolver nightly" - -before_install: -# Using compiler above sets CC to an invalid value, so unset it -- unset CC - -# Download and unpack the stack executable -- export PATH=$HOME/.local/bin:$PATH -- mkdir -p ~/.local/bin -- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' - -install: -- stack -j1 --no-terminal --install-ghc $ARGS test --bench --only-dependencies - -script: -- stack -j1 --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps --ghc-options=-Werror diff --git a/cabal.project b/cabal.project index 4b3a69e..f159390 100644 --- a/cabal.project +++ b/cabal.project @@ -1,12 +1,5 @@ packages: . jobs: $ncpus -package * - haddock-html: true - haddock-hoogle: true - haddock-hyperlink-source: true - haddock-quickjump: true - package freer-simple ghc-options: -j - haddock-options: "--optghc=-Wno-unused-imports" diff --git a/cabal.project.ci b/cabal.project.ci new file mode 100644 index 0000000..92b6343 --- /dev/null +++ b/cabal.project.ci @@ -0,0 +1,5 @@ +package freer-simple + ghc-options: -Werror + documentation: true + benchmarks: true + tests: true diff --git a/freer-simple.cabal b/freer-simple.cabal index 221bb32..a78831e 100644 --- a/freer-simple.cabal +++ b/freer-simple.cabal @@ -28,14 +28,14 @@ license-file: LICENSE homepage: https://github.com/lexi-lambda/freer-simple bug-reports: https://github.com/lexi-lambda/freer-simple/issues -source-repository head - type: git - location: https://github.com/lexi-lambda/freer-simple - extra-source-files: CHANGELOG.md README.md +source-repository head + type: git + location: https://github.com/lexi-lambda/freer-simple + common common ghc-options: -Wall