Update CHANGELOG for #357 #860
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: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ 'oldstable', 'stable' ] | |
services: | |
mysql: | |
image: mysql:8.0 | |
env: | |
MYSQL_ROOT_PASSWORD: pass | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping -ppass" | |
--health-interval 10s | |
--health-start-period 10s | |
--health-timeout 5s | |
--health-retries 10 | |
steps: | |
- name: MySQL Setup | |
run: > | |
echo -e "[client]\nuser = root\npassword = pass\nhost = localhost\nprotocol = tcp" > $HOME/.my.cnf | |
&& chmod 600 $HOME/.my.cnf | |
&& mysql --execute 'CREATE DATABASE dialect_droppable;' | |
&& mysql --execute 'CREATE DATABASE driver_droppable;' | |
- name: LibSQL Setup | |
run: | | |
mkdir -p ./regexp \ | |
&& wget https://github.com/nalgeon/sqlean/releases/download/0.27.1/sqlean-linux-x86.zip \ | |
&& unzip sqlean-linux-x86.zip regexp.so \ | |
&& rm sqlean-linux-x86.zip \ | |
&& sha256sum regexp.so > ./regexp/trusted.lst \ | |
&& mv regexp.so ./regexp \ | |
&& docker run -d -p 8080:8080 -p 8000:8000 --rm -v ${{ github.workspace }}/regexp:/var/lib/sqld/regexp \ | |
ghcr.io/tursodatabase/libsql-server:c6e4e09 sqld \ | |
--http-listen-addr=0.0.0.0:8080 \ | |
--admin-listen-addr=0.0.0.0:8000 \ | |
--enable-namespaces \ | |
--extensions-path /var/lib/sqld/regexp \ | |
&& sleep 1 \ | |
&& curl -X POST http://localhost:8000/v1/namespaces/one/create \ | |
-H "Content-Type: application/json" \ | |
--data '{}' \ | |
&& curl -X POST http://localhost:8000/v1/namespaces/one/config \ | |
-H "Content-Type: application/json" \ | |
--data '{"block_reads": false, "block_writes": false, "block_reason": null, "max_db_size": "1000.0 PB", "heartbeat_url": null, "jwt_key": null, "allow_attach": true, "txn_timeout_s": null, "durability_mode": "relaxed"}' | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install Dependencies | |
run: go mod download | |
- name: Run tests | |
env: | |
MYSQL_DIALECT_TEST_DSN: root:pass@(localhost:3306)/dialect_droppable?tls=skip-verify&multiStatements=true | |
MYSQL_DRIVER_TEST_DSN: root:pass@(localhost:3306)/driver_droppable?tls=skip-verify&multiStatements=true | |
run: go test -timeout 20m -race -covermode atomic -coverprofile=covprofile.out -coverpkg=github.com/stephenafamo/bob/... ./... | |
- name: Send coverage | |
uses: shogo82148/actions-goveralls@v1 | |
with: | |
path-to-profile: covprofile.out | |
flag-name: go-${{ matrix.go }} | |
parallel: true | |
finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: shogo82148/actions-goveralls@v1 | |
with: | |
parallel-finished: true | |
test-windows-sqlite: | |
# Run generation test on windows to catch filepath issues | |
# Testing Postgres, MySQL, and LibSQL are not possible since the windows runner | |
# does not support containers | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
go: ['stable'] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install Dependencies | |
run: go mod download | |
- name: Run tests | |
run: go test -race -run '^(TestAssembleSQLite)$' ./gen/bobgen-sqlite/driver |