Add support for parsing weeks (#29) #90
This file contains hidden or 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: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| meta: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - run: cabal check | |
| gild: | |
| name: Gild | |
| needs: meta | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - 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 | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - 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 | |
| - run: echo DOCUMENTATION=${{ matrix.documentation && '--enable-documentation --haddock-for-hackage' || '' }} >> $GITHUB_ENV | |
| - run: cabal configure $DOCUMENTATION --enable-tests --flags=pedantic --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@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | |
| path: ~/.local/state/cabal | |
| restore-keys: ${{ matrix.os }}-${{ matrix.ghc }}- | |
| - run: cabal build --only-download | |
| - uses: ikalnytskyi/action-setup-postgres@10ab8a56cc77b4823c2bfa57b1d4dd5605ef0481 # v7 | |
| with: | |
| postgres-version: ${{ matrix.postgres }} | |
| - run: cabal build --only-dependencies | |
| - run: cabal build | |
| - if: ${{ env.DOCUMENTATION }} | |
| run: cp dist-newstyle/${{ needs.meta.outputs.name }}-${{ needs.meta.outputs.version }}-docs.tar.gz artifact | |
| - run: tar --create --file artifact.tar --verbose artifact | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: postgresql-simple-interval-${{ github.sha }}-${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.postgres }} | |
| path: artifact.tar | |
| - env: | |
| PGPASSWORD: postgres | |
| run: cabal 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 | |
| release: | |
| if: ${{ github.event_name == 'release' }} | |
| name: Release | |
| needs: | |
| - build | |
| - meta | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.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@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2 | |
| 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 |