name: bld-ci on: [ push, pull_request, workflow_dispatch ] env: REPORTS_DIR: "build/test-results/test/" # Test flags for DB runs DB_TEST_FLAGS: >- -Dtest.postgres=true -Dtest.mysql=true -Dtest.mariadb=true -Dtest.oracle=true -Dtest.oracle-free=true -DtestsBadgeUrl=https://rife2.com/tests-badge/update/com.uwyn.rife2/bld -DtestsBadgeApiKey=${{ secrets.TESTS_BADGE_API_KEY }} jobs: build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] java-version: [ 17, 21, 25, 26 ] include: - os: ubuntu-latest run-db-tests: true bld-cmd: ./bld # DB config only for ubuntu jobs DB_NAME: unittests DB_USER: unittests DB_PASSWORD: password 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 run-db-tests: false bld-cmd: ./bld - os: windows-latest run-db-tests: false bld-cmd: .\bld.bat services: oracle: image: ${{ matrix.ORACLE_XE_IMAGE }} env: ORACLE_RANDOM_PASSWORD: true APP_USER: ${{ matrix.DB_USER }} APP_USER_PASSWORD: ${{ matrix.DB_PASSWORD }} ports: - 1521:1521 options: >- --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10 oracle-free: image: ${{ matrix.ORACLE_FREE_IMAGE }} env: ORACLE_RANDOM_PASSWORD: true APP_USER: ${{ matrix.DB_USER }} APP_USER_PASSWORD: ${{ matrix.DB_PASSWORD }} ports: - 1522:1521 options: >- --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10 mysql: image: ${{ matrix.MYSQL_IMAGE }} env: MYSQL_DATABASE: ${{ matrix.DB_NAME }} MYSQL_USER: ${{ matrix.DB_USER }} MYSQL_PASSWORD: ${{ matrix.DB_PASSWORD }} MYSQL_ROOT_PASSWORD: root ports: - 3306:3306 options: >- --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 mariadb: image: ${{ matrix.MARIADB_IMAGE }} env: MARIADB_DATABASE: ${{ matrix.DB_NAME }} MARIADB_USER: ${{ matrix.DB_USER }} MARIADB_PASSWORD: ${{ matrix.DB_PASSWORD }} MARIADB_ROOT_PASSWORD: root ports: - 3307:3306 options: >- --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 postgres: image: ${{ matrix.POSTGRES_IMAGE }} env: POSTGRES_DB: ${{ matrix.DB_NAME }} POSTGRES_PASSWORD: ${{ matrix.DB_PASSWORD }} POSTGRES_USER: ${{ matrix.DB_USER }} options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries=5 ports: - 5432:5432 steps: - name: Configure git line endings for Windows if: runner.os == 'Windows' run: git config --global core.autocrlf input - name: Checkout source repository uses: actions/checkout@v4 with: clean: true submodules: "true" fetch-depth: 0 - name: Set up JDK ${{ matrix.java-version }} uses: actions/setup-java@v4 with: distribution: "corretto" java-version: ${{ matrix.java-version }} check-latest: true - name: Cache bld dependencies uses: actions/cache@v4 with: path: lib key: ${{ runner.os }}-bld-java${{ matrix.java-version }}-lib - name: Compile source run: ${{ matrix.bld-cmd }} clean compile - name: Run tests id: tests run: >- ${{ matrix.bld-cmd }} test --reports-dir=${{ env.REPORTS_DIR }} ${{ matrix.run-db-tests && env.DB_TEST_FLAGS || '' }} - name: Run reporter if: always() && steps.tests.outcome == 'failure' run: ${{ matrix.bld-cmd }} --offline reporter --all