diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml new file mode 100644 index 0000000..e2a6d18 --- /dev/null +++ b/.github/workflows/build-and-test.yaml @@ -0,0 +1,40 @@ +name: Compile, test and check the docs + +on: + workflow_call: + +jobs: + + test: + + strategy: + fail-fast: false + matrix: + include: + - ghc: 8.8.1 + ghc-options: "" + - ghc: latest + + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + env: + POSTGRES_USER: postgres + POSTGRES_DB: postgres + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + + - uses: nikita-volkov/build-and-test-cabal-package.github-action@v1 + with: + ghc: ${{matrix.ghc}} + ghc-options: ${{matrix.ghc-options}} diff --git a/.github/workflows/format-and-test.yaml b/.github/workflows/on-push-to-master-or-pr.yaml similarity index 70% rename from .github/workflows/format-and-test.yaml rename to .github/workflows/on-push-to-master-or-pr.yaml index 42b468c..e2181db 100644 --- a/.github/workflows/format-and-test.yaml +++ b/.github/workflows/on-push-to-master-or-pr.yaml @@ -13,5 +13,5 @@ jobs: secrets: inherit test: - uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/test-with-postgres.yaml@v1 + uses: ./.github/workflows/build-and-test.yaml secrets: inherit diff --git a/.github/workflows/release.yaml b/.github/workflows/on-push-to-release.yaml similarity index 81% rename from .github/workflows/release.yaml rename to .github/workflows/on-push-to-release.yaml index e922700..3d5947f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/on-push-to-release.yaml @@ -18,14 +18,14 @@ jobs: uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/format.yaml@v1 secrets: inherit - test: - uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/test.yaml@v1 + verify: + uses: ./.github/workflows/build-and-test.yaml secrets: inherit release: needs: - format - - test + - verify uses: nikita-volkov/haskell-hackage-lib-github-actions-workflows/.github/workflows/release.yaml@v1 secrets: inherit with: