From 93534424e403bc06e044174cbb9d9f61eba7a309 Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Fri, 13 Oct 2023 01:59:59 +0300 Subject: [PATCH] Move to Github Actions --- .github/workflows/format.yaml | 12 +++++++ .github/workflows/release.yaml | 21 ++++++++++++ .github/workflows/test.yaml | 29 ++++++++++++++++ .travis.yml | 61 ---------------------------------- 4 files changed, 62 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/format.yaml create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/test.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..9f46f3a --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,12 @@ +name: Format the code + +on: + push: + branches: + - master + pull_request: + +jobs: + format: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format-stage.yaml@7e8df8d36f4b50ec4c3585aaaed4bf3892f313f2 + secrets: inherit diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..9db2de4 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,21 @@ +name: Release the lib to Hackage + +on: + push: + branches: + - supermajor + - major + - minor + - patch + +concurrency: + group: release + cancel-in-progress: false + +jobs: + + release: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/release-stage.yaml@7e8df8d36f4b50ec4c3585aaaed4bf3892f313f2 + secrets: inherit + with: + prefix-tag-with-v: false diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..19057dd --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,29 @@ +name: Compile, test and check the docs + +on: + push: + branches: + - master + pull_request: + +jobs: + + test: + uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/test-stage.yaml@7e8df8d36f4b50ec4c3585aaaed4bf3892f313f2 + secrets: inherit + + # Service containers to run with `container-job` + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres + # Provide the password for postgres + env: + POSTGRES_PASSWORD: postgres + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6c4882d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,61 +0,0 @@ -if: tag IS blank - -env: - - ghc=8.6.1 - - ghc=8.8.1 - - ghc=8.10.2 benchmarks=1 tests=1 - - ghc=9.0.1 - -matrix: - allow_failures: - - env: ghc=9.0.1 - -services: - - postgresql - -install: - # Set up the Shell to treat the semicolon as && - - set -eo pipefail - # Install GHC and Cabal - - - cabal=${cabal=2.4}; - travis_retry sudo add-apt-repository -y ppa:hvr/ghc; - travis_retry sudo apt-get update; - travis_retry sudo apt-get install cabal-install-$cabal ghc-$ghc; - export PATH=/opt/ghc/$ghc/bin:/opt/cabal/$cabal/bin:$PATH; - # Update the Cabal database - - cabal update - # Switch to the distro: - - - export pkg_name=$(cabal info . | awk '{print $2;exit}'); - cabal sdist; - cd dist; - tar xzvf $pkg_name.tar.gz; - cd $pkg_name; - # Install the lower bound dependencies - - - if [ "$lower_bound_dependencies" = "1" ]; - then - constraint_options=( - ); - fi; - # Install the library dependencies - - cabal v1-install --only-dependencies --reorder-goals --force-reinstalls - ${constraint_options[@]} - $([ "$tests" = "1" ] && echo "--enable-tests") - $([ "$benchmarks" = "1" ] && echo "--enable-benchmarks") - # Build the library - - cabal v1-build - # Configure and build the remaining stuff - - cabal v1-configure - $([ "$tests" = "1" ] && echo "--enable-tests") - $([ "$benchmarks" = "1" ] && echo "--enable-benchmarks") - -f doctest - - cabal v1-build - -script: - - | - if [ "$tests" = "1" ]; - then - cabal v1-test --show-details=always; - fi;