Refactor to allow more customization for the way the request and response are handled #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "ci" | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
release: | |
types: ["published"] | |
jobs: | |
hlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Set up hlint" | |
uses: haskell/actions/hlint-setup@v2 | |
with: | |
version: "3.8" | |
- name: "Run hlint" | |
uses: haskell/actions/hlint-run@v2 | |
with: | |
path: '["src/", "test/"]' | |
fail-on: warning | |
fourmolu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: haskell-actions/run-fourmolu@v9 | |
with: | |
version: "0.15.0.0" | |
cabal: | |
name: cabal ${{ matrix.cabal }} / ghc ${{ matrix.ghc }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest"] | |
cabal: ["3.10.3.0"] | |
ghc: | |
- "9.4.8" | |
- "9.6.5" | |
- "9.8.2" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: "./.github/actions/cabal-build" | |
name: Build | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
stack: | |
name: stack ${{ matrix.stack }} / ${{ matrix.resolver }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: ["ubuntu-latest"] | |
stack: ["2.15.5"] | |
resolver: | |
- "lts-21" | |
- "lts-22" | |
- "nightly" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: "./.github/actions/stack-build" | |
name: Build | |
with: | |
resolver: ${{ matrix.resolver }} | |
stack-version: ${{ matrix.stack }} | |
publish: | |
name: "publish" | |
runs-on: "ubuntu-latest" | |
needs: | |
- hlint | |
- fourmolu | |
- cabal | |
- stack | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/setup@v2 | |
id: setup-haskell-cabal | |
name: Setup Haskell and Cabal | |
with: | |
ghc-version: "9.8.2" | |
cabal-version: "3.10.3.0" | |
- name: Freeze | |
run: | | |
cabal freeze | |
head -n -1 cabal.project.freeze > deps | |
- uses: actions/cache@v3 | |
name: Cache ~/.cabal/store | |
with: | |
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | |
key: publish-${{ hashFiles('deps') }} | |
- name: "Bundle the package" | |
run: | | |
cabal sdist | |
- name: "Bundle the documentation" | |
run: | | |
cabal haddock --haddock-for-hackage --enable-doc | |
- name: "Publish package to Hackage" | |
if: github.event_name == 'release' | |
env: | |
HACKAGE_USER: ${{ secrets.HACKAGE_USER }} | |
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} | |
run: | | |
cabal upload --publish -u $HACKAGE_USER -p $HACKAGE_PASSWORD ./dist-newstyle/sdist/*.tar.gz | |
- name: "Publish candidate package to Hackage" | |
if: github.event_name == 'push' | |
env: | |
HACKAGE_USER: ${{ secrets.HACKAGE_USER }} | |
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} | |
run: | | |
cabal upload -u $HACKAGE_USER -p $HACKAGE_PASSWORD ./dist-newstyle/sdist/*.tar.gz | |
- name: "Publish docs to Hackage" | |
if: github.event_name == 'release' | |
env: | |
HACKAGE_USER: ${{ secrets.HACKAGE_USER }} | |
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} | |
run: | | |
cabal upload --publish -u $HACKAGE_USER -p $HACKAGE_PASSWORD -d ./dist-newstyle/*-docs.tar.gz | |
- name: "Publish candidate docs to Hackage" | |
if: github.event_name == 'push' | |
env: | |
HACKAGE_USER: ${{ secrets.HACKAGE_USER }} | |
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }} | |
run: | | |
cabal upload -u $HACKAGE_USER -p $HACKAGE_PASSWORD -d ./dist-newstyle/*-docs.tar.gz |