mirror of
https://github.com/rife2/bld
synced 2026-06-29 23:27:47 +02:00
Merge pull request #88 from ethauvin/main
Move database images to the workflow matrix
This commit is contained in:
commit
c8dbd3179e
34
.github/workflows/bld.yml
vendored
34
.github/workflows/bld.yml
vendored
|
|
@ -4,14 +4,6 @@ on: [ push, pull_request, workflow_dispatch ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REPORTS_DIR: "build/test-results/test/"
|
REPORTS_DIR: "build/test-results/test/"
|
||||||
# Database versions - change these to upgrade
|
|
||||||
POSTGRES_IMAGE: "postgres:15"
|
|
||||||
MYSQL_IMAGE: "mysql:8"
|
|
||||||
MARIADB_IMAGE: "mariadb:10.9"
|
|
||||||
ORACLE_XE_IMAGE: "gvenzl/oracle-xe:18-slim"
|
|
||||||
ORACLE_FREE_IMAGE: "gvenzl/oracle-free:latest"
|
|
||||||
|
|
||||||
# DB credentials
|
|
||||||
DB_NAME: unittests
|
DB_NAME: unittests
|
||||||
DB_USER: unittests
|
DB_USER: unittests
|
||||||
DB_PASSWORD: password
|
DB_PASSWORD: password
|
||||||
|
|
@ -38,6 +30,12 @@ jobs:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
run-db-tests: true
|
run-db-tests: true
|
||||||
bld-cmd: ./bld
|
bld-cmd: ./bld
|
||||||
|
# Only ubuntu gets DB services
|
||||||
|
POSTGRES_IMAGE: "postgres:15"
|
||||||
|
MYSQL_IMAGE: "mysql:8"
|
||||||
|
MARIADB_IMAGE: "mariadb:10.9"
|
||||||
|
ORACLE_XE_IMAGE: "gvenzl/oracle-xe:18-slim"
|
||||||
|
ORACLE_FREE_IMAGE: "gvenzl/oracle-free:latest"
|
||||||
- os: macos-latest
|
- os: macos-latest
|
||||||
run-db-tests: false
|
run-db-tests: false
|
||||||
bld-cmd: ./bld
|
bld-cmd: ./bld
|
||||||
|
|
@ -45,9 +43,11 @@ jobs:
|
||||||
run-db-tests: false
|
run-db-tests: false
|
||||||
bld-cmd: .\bld.bat
|
bld-cmd: .\bld.bat
|
||||||
|
|
||||||
|
# Only define services when run-db-tests is true
|
||||||
|
# GitHub skips this whole block if matrix doesn't define the images
|
||||||
services:
|
services:
|
||||||
oracle:
|
oracle:
|
||||||
image: ${{ matrix.run-db-tests && env.ORACLE_XE_IMAGE || '' }}
|
image: ${{ matrix.ORACLE_XE_IMAGE }}
|
||||||
env:
|
env:
|
||||||
ORACLE_RANDOM_PASSWORD: true
|
ORACLE_RANDOM_PASSWORD: true
|
||||||
APP_USER: ${{ env.DB_USER }}
|
APP_USER: ${{ env.DB_USER }}
|
||||||
|
|
@ -61,7 +61,7 @@ jobs:
|
||||||
--health-retries 10
|
--health-retries 10
|
||||||
|
|
||||||
oracle-free:
|
oracle-free:
|
||||||
image: ${{ matrix.run-db-tests && env.ORACLE_FREE_IMAGE || '' }}
|
image: ${{ matrix.ORACLE_FREE_IMAGE }}
|
||||||
env:
|
env:
|
||||||
ORACLE_RANDOM_PASSWORD: true
|
ORACLE_RANDOM_PASSWORD: true
|
||||||
APP_USER: ${{ env.DB_USER }}
|
APP_USER: ${{ env.DB_USER }}
|
||||||
|
|
@ -75,7 +75,7 @@ jobs:
|
||||||
--health-retries 10
|
--health-retries 10
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
image: ${{ matrix.run-db-tests && env.MYSQL_IMAGE || '' }}
|
image: ${{ matrix.MYSQL_IMAGE }}
|
||||||
env:
|
env:
|
||||||
MYSQL_DATABASE: ${{ env.DB_NAME }}
|
MYSQL_DATABASE: ${{ env.DB_NAME }}
|
||||||
MYSQL_USER: ${{ env.DB_USER }}
|
MYSQL_USER: ${{ env.DB_USER }}
|
||||||
|
|
@ -90,7 +90,7 @@ jobs:
|
||||||
--health-retries=3
|
--health-retries=3
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
image: ${{ matrix.run-db-tests && env.MARIADB_IMAGE || '' }}
|
image: ${{ matrix.MARIADB_IMAGE }}
|
||||||
env:
|
env:
|
||||||
MARIADB_DATABASE: ${{ env.DB_NAME }}
|
MARIADB_DATABASE: ${{ env.DB_NAME }}
|
||||||
MARIADB_USER: ${{ env.DB_USER }}
|
MARIADB_USER: ${{ env.DB_USER }}
|
||||||
|
|
@ -105,7 +105,7 @@ jobs:
|
||||||
--health-retries=3
|
--health-retries=3
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: ${{ matrix.run-db-tests && env.POSTGRES_IMAGE || '' }}
|
image: ${{ matrix.POSTGRES_IMAGE }}
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: ${{ env.DB_NAME }}
|
POSTGRES_DB: ${{ env.DB_NAME }}
|
||||||
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
|
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
|
||||||
|
|
@ -129,21 +129,21 @@ jobs:
|
||||||
run: git config --global core.autocrlf input
|
run: git config --global core.autocrlf input
|
||||||
|
|
||||||
- name: Checkout source repository
|
- name: Checkout source repository
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
clean: true
|
clean: true
|
||||||
submodules: "true"
|
submodules: "true"
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up JDK ${{ matrix.java-version }}
|
- name: Set up JDK ${{ matrix.java-version }}
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: "corretto"
|
distribution: "corretto"
|
||||||
java-version: ${{ matrix.java-version }}
|
java-version: ${{ matrix.java-version }}
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Cache bld dependencies
|
- name: Cache bld dependencies
|
||||||
uses: actions/cache@v6
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: lib
|
path: lib
|
||||||
key: ${{ runner.os }}-bld-java${{ matrix.java-version }}-lib
|
key: ${{ runner.os }}-bld-java${{ matrix.java-version }}-lib
|
||||||
|
|
@ -160,4 +160,4 @@ jobs:
|
||||||
|
|
||||||
- name: Run reporter
|
- name: Run reporter
|
||||||
if: always() && steps.tests.outcome == 'failure'
|
if: always() && steps.tests.outcome == 'failure'
|
||||||
run: ${{ matrix.bld-cmd }} --offline reporter --all
|
run: ${{ matrix.bld-cmd }} --offline reporter --all
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue