Skip to content

Bump actions/cache from 5.0.1 to 5.0.2 #154

Bump actions/cache from 5.0.1 to 5.0.2

Bump actions/cache from 5.0.1 to 5.0.2 #154

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
release:
types:
- created
jobs:
meta:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- id: name
run: "echo name=$( grep '^name: ' *.cabal | cut -d ' ' -f 2 ) >> $GITHUB_OUTPUT"
- id: version
run: "echo version=$( grep '^version:' *.cabal | cut -d ' ' -f 2 ) >> $GITHUB_OUTPUT"
outputs:
name: ${{ steps.name.outputs.name }}
version: ${{ steps.version.outputs.version }}
cabal:
name: Cabal
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- run: cabal check
gild:
name: Gild
needs: meta
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: tfausak/cabal-gild-setup-action@5aa7281b9e1d33818ed53230eef6f73dda3f89e1 # v2
- run: cabal-gild --input ${{ needs.meta.outputs.name }}.cabal --mode check
hlint:
name: HLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: haskell-actions/hlint-setup@fe9cd1cd1af94a23900c06738e73f6ddb092966a # v2.4.10
- uses: haskell-actions/hlint-run@eaca4cfbf4a69f4eb875df38b6bc3e1657020378 # v2.4.10
with:
fail-on: status
ormolu:
name: Ormolu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: haskell-actions/run-ormolu@c5eec49879ee294be01c787bcbf7b5a373a37060 # v17
build:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }} with PostgreSQL ${{ matrix.postgres }}
needs: meta
runs-on: ${{ matrix.os }}-latest
env:
# Use short builddir on Windows to avoid MAX_PATH (260 char) limitations
BUILDDIR: ${{ matrix.os == 'windows' && 'C:/b' || 'dist-newstyle' }}
DOCUMENTATION: ${{ matrix.documentation && '--enable-documentation --haddock-for-hackage' || '' }}
WINDOWS_FLAGS: ${{ matrix.os == 'windows' && '--constraint="postgresql-libpq +use-pkg-config"' || '' }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- run: mkdir artifact
- uses: haskell/ghcup-setup@2860d0b41e2c5aa7d005bcbc2bd2506a09557ed8 # v1.2.2
with:
ghc: ${{ matrix.ghc }}
cabal: latest
- run: ghc-pkg list
- run: cabal sdist --output-dir artifact
- uses: ikalnytskyi/action-setup-postgres@c4dda34aae1c821e3a771b68b73b13af3198a7ee # v8
with:
postgres-version: ${{ matrix.postgres }}
# Windows: Install MSYS2's libpq which provides MinGW-compatible libraries
# The Windows PostgreSQL installer provides MSVC libraries which don't link with GHC's MinGW toolchain
- if: matrix.os == 'windows'
name: Install MSYS2 PostgreSQL client library
shell: pwsh
run: |
& "$env:GHCUP_MSYS2\usr\bin\bash.exe" -lc "pacman -S --noconfirm mingw-w64-x86_64-postgresql mingw-w64-x86_64-pkgconf"
$newPath = ($env:PATH.Split(';') | Where-Object { $_ -notlike '*Strawberry*' }) -join ';'
$msys2Bin = "$env:GHCUP_MSYS2\mingw64\bin"
$pgBin = "C:\Program Files\PostgreSQL\${{ matrix.postgres }}\bin"
echo "PATH=$msys2Bin;$pgBin;$newPath" >> $env:GITHUB_ENV
echo "$msys2Bin" >> $env:GITHUB_PATH
echo "$pgBin" >> $env:GITHUB_PATH
echo "PKG_CONFIG_PATH=$env:GHCUP_MSYS2\mingw64\lib\pkgconfig" >> $env:GITHUB_ENV
- run: cabal configure ${{ env.DOCUMENTATION }} --enable-tests --flags=pedantic ${{ env.WINDOWS_FLAGS }} --jobs
- run: cat cabal.project.local
- run: cp cabal.project.local artifact
- run: cabal update
- run: cabal freeze
- run: cat cabal.project.freeze
- run: cp cabal.project.freeze artifact
- run: cabal outdated --v2-freeze-file
- uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
with:
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
path: |
${{ matrix.os == 'windows' && '~\AppData\Roaming\cabal' || '~/.local/state/cabal' }}
restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}-
- run: cabal --builddir=${{ env.BUILDDIR }} build --only-download
- run: cabal --builddir=${{ env.BUILDDIR }} build --only-dependencies
- run: cabal --builddir=${{ env.BUILDDIR }} build
- if: ${{ matrix.documentation }}
run: cp ${{ env.BUILDDIR }}/${{ needs.meta.outputs.name }}-${{ needs.meta.outputs.version }}-docs.tar.gz artifact
- run: tar --create --file artifact.tar --verbose artifact
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: postgresql-simple-interval-${{ github.sha }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.postgres }}
path: artifact.tar
- env:
PGPASSWORD: postgres
run: cabal --builddir=${{ env.BUILDDIR }} run -- postgresql-simple-interval-test-suite --randomize
strategy:
matrix:
include:
- documentation: false
ghc: '9.12'
postgres: 17
os: macos
- documentation: false
ghc: '8.8'
postgres: 17
os: ubuntu
- documentation: false
ghc: '8.10'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.0'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.2'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.4'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.6'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.8'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.10'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.12'
postgres: 14
os: ubuntu
- documentation: false
ghc: '9.12'
postgres: 15
os: ubuntu
- documentation: false
ghc: '9.12'
postgres: 16
os: ubuntu
- documentation: true
ghc: '9.12'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.14'
postgres: 17
os: ubuntu
- documentation: false
ghc: '9.12'
postgres: 17
os: windows
release:
if: ${{ github.event_name == 'release' }}
name: Release
needs:
- build
- meta
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: postgresql-simple-interval-${{ github.sha }}-ubuntu-9.12-17
- run: tar --extract --file artifact.tar --verbose
- uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: artifact/${{ needs.meta.outputs.name }}-${{ needs.meta.outputs.version }}.tar.gz
- run: echo PUBLISH=${{ github.event_name == 'release' && '--publish' || '' }} >> $GITHUB_ENV
- run: cabal upload $PUBLISH --token '${{ secrets.HACKAGE_TOKEN }}' artifact/${{ needs.meta.outputs.name }}-${{ needs.meta.outputs.version }}.tar.gz
- run: cabal --http-transport=plain-http upload --documentation $PUBLISH --token '${{ secrets.HACKAGE_TOKEN }}' artifact/${{ needs.meta.outputs.name }}-${{ needs.meta.outputs.version }}-docs.tar.gz