Skip to content

Support for the migration framework in beam-duckdb #892

Support for the migration framework in beam-duckdb

Support for the migration framework in beam-duckdb #892

Workflow file for this run

name: Build
on:
push:
paths-ignore:
- '.github/workflows/docs.yaml'
- 'docs/*/**'
branches: [master]
pull_request:
paths-ignore:
- '.github/workflows/docs.yaml'
- 'docs/*/**'
jobs:
continuous-integration:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The 'cabal-flags' option is typically non-empty for new
# GHC releases, for which we may need `--allow-newer` flags
# while dependencies are updated.
include:
- ghc-version: "8.10.7"
duckdb: false
- ghc-version: "9.0.2"
duckdb: false
- ghc-version: "9.2.8"
duckdb: false
- ghc-version: "9.4.8"
duckdb: false
- ghc-version: "9.6.7"
duckdb: true
- ghc-version: "9.8.4"
duckdb: true
- ghc-version: "9.10.3"
duckdb: true
- ghc-version: "9.12.2"
duckdb: true
- ghc-version: "9.14.1"
duckdb: true
steps:
- uses: actions/checkout@v4
- name: Install cabal/ghc
uses: haskell-actions/setup@v2
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: '3.12.1.0'
# duckdb-simple is only supported for GHC 9.6+
- name: Disable beam-duckdb
if: ${{ !matrix.duckdb }}
run: |
sed -i '/beam-duckdb/d' ./cabal.project
sed -i '/beam-backend-bench/d' ./cabal.project
- name: Generate freeze file
run: |
cabal update
cabal configure --disable-optimization
cabal freeze
# Exclude the timestamp of Hackage index update from our cache key, to
# avoid invalidating cache too often.
# This idea comes from github.com/jaspervdj/hakyll
sed '/^index-state: /d' cabal.project.freeze > dependencies-versions
- name: Cache cabal work
uses: actions/cache@v4
with:
path: |
dist-newstyle
${{ steps.setup-haskell.outputs.cabal-store }}
key: ${{ runner.os }}-${{ hashFiles('dependencies-versions', 'cabal.project.local') }}-cabal-install
- name: Install DuckDB artifact
if: ${{ matrix.duckdb }}
run: |
curl -L -o libduckdb.zip https://github.com/duckdb/duckdb/releases/download/v1.5.2/libduckdb-linux-amd64.zip && \
unzip libduckdb.zip
sudo mv libduckdb.so /usr/lib/libduckdb.so
sudo mv duckdb.h /usr/include/
sudo ldconfig
rm libduckdb.zip
- name: Build dependencies
run: |
cabal build all --only-dependencies
- name: Build beam packages
run: |
cabal build all
- name: Run tests
run: |
cabal test all
- name: Run benchmarks
if: ${{ matrix.duckdb }}
run: |
BEAM_BENCH_ROWS=100000 cabal -v0 bench beam-backend-bench:beam-postgres && cabal -v0 bench beam-backend-bench:beam-sqlite && cabal -v0 bench beam-backend-bench:beam-duckdb
release-artifacts:
# Only build release artifacts if `continuous-integration` is successful
needs: [continuous-integration]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# Note that we do not check `beam-backend-bench` because this package is
# not meant to be released.
- name: Check packages for common mistakes
run: |
for pkg in $(find . -mindepth 1 -maxdepth 1 -type d -name "beam-*" -not -name "beam-backend-bench")
do
cd $pkg
echo "Checking $pkg"
cabal check
cd $GITHUB_WORKSPACE
done
# Note that the ubuntu-24.04 image includes cabal
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#haskell-tools
- name: Build release artifacts
run : |
cabal sdist all
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: github.ref == 'refs/heads/master'
with:
name: ${{ runner.os }}-release-artifact
path: dist-newstyle/sdist/beam-*
retention-days: 7