From a5a0ed76de4fe1c09dc9511b6010a945ce2765fd Mon Sep 17 00:00:00 2001 From: Jason Shin Date: Sat, 13 Jan 2024 17:55:24 +1100 Subject: [PATCH] DB multi-versions tests (#94) * chore: adding env vars * test * hmm * chore: try the new syntax * chore: new syntax fix --- .github/workflows/rust-test.yaml | 14 ++++++++++++++ docker-compose.yml | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust-test.yaml b/.github/workflows/rust-test.yaml index 61fdb21a..f7bbcdf5 100644 --- a/.github/workflows/rust-test.yaml +++ b/.github/workflows/rust-test.yaml @@ -12,6 +12,17 @@ env: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + db: + - mysql: 8 + - mysql: 5.7 + - mysql: 5.6 + - postgres: 16 + - postgres: 15 + - postgres: 14 + - postgres: 13 + - postgres: 12 steps: - name: Checkout sources @@ -37,6 +48,9 @@ jobs: - name: build docker-compose services for integration tests run: docker-compose -f docker-compose.yml up -d + env: + MYSQL_VERSION: ${{ matrix.db.mysql }} + PG_VERSION: ${{ matrix.db.postgres }} - uses: GuillaumeFalourd/wait-sleep-action@v1 with: diff --git a/docker-compose.yml b/docker-compose.yml index 518c37c9..c6616a4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3.1' services: postgres: - image: postgres:13 + image: postgres:${PG_VERSION:-13} restart: always environment: POSTGRES_PASSWORD: postgres @@ -13,7 +13,7 @@ services: - 54321:5432 mysql: - image: mysql:8 + image: mysql:${MYSQL_VERSION:-8} restart: always volumes: - ./playpen/db/mysql_migration.sql:/docker-entrypoint-initdb.d/mysql_migration.sql