Merge pull request #345 from cole-miller/v2-packages #535
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 tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
build-and-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
go: | |
- '1.13' | |
- stable | |
os: | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Setup dependencies | |
run: | | |
sudo add-apt-repository ppa:dqlite/dev -y | |
sudo apt update | |
sudo apt install -y libsqlite3-dev libuv1-dev liblz4-dev libdqlite1.17-dev | |
- name: Download deps | |
run: | | |
go get -t -tags libsqlite3 ./... | |
- name: Test | |
env: | |
GO_DQLITE_MULTITHREAD: 1 | |
run: | | |
go test -v -tags libsqlite3 -race -coverprofile=coverage.out ./... | |
go test -v -tags nosqlite3 ./... | |
VERBOSE=1 ./test/dqlite-demo.sh | |
VERBOSE=1 ./test/roles.sh | |
VERBOSE=1 ./test/recover.sh | |
- name: Coverage | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage.out | |
parallel: true | |
- name: Benchmark | |
env: | |
GO_DQLITE_MULTITHREAD: 1 | |
run: | | |
go install -tags libsqlite3 github.com/canonical/go-dqlite/v2/cmd/dqlite-benchmark | |
dqlite-benchmark --db 127.0.0.1:9001 --driver --cluster 127.0.0.1:9001,127.0.0.1:9002,127.0.0.1:9003 --workload kvreadwrite & | |
masterpid=$! | |
dqlite-benchmark --db 127.0.0.1:9002 --join 127.0.0.1:9001 & | |
dqlite-benchmark --db 127.0.0.1:9003 --join 127.0.0.1:9001 & | |
wait $masterpid | |
echo "Write results:" | |
head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-exec-* | |
echo "" | |
echo "Read results:" | |
head -n 5 /tmp/dqlite-benchmark/127.0.0.1:9001/results/0-query-* | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dqlite-benchmark-${{ matrix.os }}-${{ matrix.go }} | |
path: /tmp/dqlite-benchmark/127.0.0.1:9001/results/* | |
finish: | |
needs: build-and-test | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Finish coverage | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true |