Compare commits

..

No commits in common. "ad40825ef4aafcfbb33e54701201de24089196d3" and "f604f22474915e4c506ec8447c6ffb3546eeee31" have entirely different histories.

2 changed files with 130 additions and 69 deletions

View file

@ -1,54 +1,21 @@
name: bld-ci name: bld-ci
on: [ push, pull_request, workflow_dispatch ] on: [push, pull_request, workflow_dispatch]
env: env:
REPORTS_DIR: "build/test-results/test/" 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: jobs:
build: build-linux:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
java-version: [ 17, 22, 24, 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: services:
oracle: oracle:
image: ${{ matrix.ORACLE_XE_IMAGE }} image: gvenzl/oracle-xe:18-slim
env: env:
ORACLE_RANDOM_PASSWORD: true ORACLE_RANDOM_PASSWORD: true
APP_USER: ${{ matrix.DB_USER }} APP_USER: unittests
APP_USER_PASSWORD: ${{ matrix.DB_PASSWORD }} APP_USER_PASSWORD: password
ports: ports:
- 1521:1521 - 1521:1521
options: >- options: >-
@ -58,11 +25,11 @@ jobs:
--health-retries 10 --health-retries 10
oracle-free: oracle-free:
image: ${{ matrix.ORACLE_FREE_IMAGE }} image: gvenzl/oracle-free:latest
env: env:
ORACLE_RANDOM_PASSWORD: true ORACLE_RANDOM_PASSWORD: true
APP_USER: ${{ matrix.DB_USER }} APP_USER: unittests
APP_USER_PASSWORD: ${{ matrix.DB_PASSWORD }} APP_USER_PASSWORD: password
ports: ports:
- 1522:1521 - 1522:1521
options: >- options: >-
@ -72,11 +39,11 @@ jobs:
--health-retries 10 --health-retries 10
mysql: mysql:
image: ${{ matrix.MYSQL_IMAGE }} image: mysql:8
env: env:
MYSQL_DATABASE: ${{ matrix.DB_NAME }} MYSQL_DATABASE: unittests
MYSQL_USER: ${{ matrix.DB_USER }} MYSQL_USER: unittests
MYSQL_PASSWORD: ${{ matrix.DB_PASSWORD }} MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: root MYSQL_ROOT_PASSWORD: root
ports: ports:
- 3306:3306 - 3306:3306
@ -87,11 +54,11 @@ jobs:
--health-retries=3 --health-retries=3
mariadb: mariadb:
image: ${{ matrix.MARIADB_IMAGE }} image: mariadb:10.9
env: env:
MARIADB_DATABASE: ${{ matrix.DB_NAME }} MARIADB_DATABASE: unittests
MARIADB_USER: ${{ matrix.DB_USER }} MARIADB_USER: unittests
MARIADB_PASSWORD: ${{ matrix.DB_PASSWORD }} MARIADB_PASSWORD: password
MARIADB_ROOT_PASSWORD: root MARIADB_ROOT_PASSWORD: root
ports: ports:
- 3307:3306 - 3307:3306
@ -102,54 +69,148 @@ jobs:
--health-retries=3 --health-retries=3
postgres: postgres:
image: ${{ matrix.POSTGRES_IMAGE }} image: postgres:15
env: env:
POSTGRES_DB: ${{ matrix.DB_NAME }} POSTGRES_DB: unittests
POSTGRES_PASSWORD: ${{ matrix.DB_PASSWORD }} POSTGRES_PASSWORD: password
POSTGRES_USER: ${{ matrix.DB_USER }} POSTGRES_PORT: 5432
POSTGRES_USER: unittests
options: >- options: >-
--health-cmd pg_isready --health-cmd pg_isready
--health-interval 10s --health-interval 10s
--health-timeout 5s --health-timeout 5s
--health-retries=5 --health-retries 5
ports: ports:
- 5432:5432 - 5432:5432
steps: env:
- name: Configure git line endings for Windows MYSQL_DATABASE: unittests
if: runner.os == 'Windows' MYSQL_USER: root
run: git config --global core.autocrlf input MYSQL_PASSWORD: root
strategy:
matrix:
java-version: [17, 22, 24, 26]
steps:
- name: Checkout source repository - name: Checkout source repository
uses: actions/checkout@v4 uses: actions/checkout@v7
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@v4 uses: actions/setup-java@v5
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@v4 id: cache-bld
uses: actions/cache@v6
with: with:
path: lib path: lib
key: ${{ runner.os }}-bld-java${{ matrix.java-version }}-lib key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
- name: Compile source - name: Compile source
run: ${{ matrix.bld-cmd }} clean compile run: ./bld clean compile
- name: Run tests - name: Run tests
id: tests id: tests
run: >- run: >-
${{ matrix.bld-cmd }} test ./bld test
-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 }}
--reports-dir=${{ env.REPORTS_DIR }} --reports-dir=${{ env.REPORTS_DIR }}
${{ matrix.run-db-tests && env.DB_TEST_FLAGS || '' }}
- 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: ./bld --offline reporter --all
build-macos:
runs-on: macos-latest
strategy:
matrix:
java-version: [17, 20, 21, 22, 23, 24, 25]
steps:
- name: Checkout source repository
uses: actions/checkout@v7
with:
clean: true
submodules: "true"
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: ${{ matrix.java-version }}
check-latest: true
- name: Cache bld dependencies
id: cache-bld
uses: actions/cache@v5
with:
path: lib
key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
restore-keys: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
- name: Compile source
run: ./bld clean compile
- name: Run tests
id: tests
run: ./bld test --reports-dir=${{ env.REPORTS_DIR }}
- name: Run reporter
if: always() && steps.tests.outcome == 'failure'
run: ./bld --offline reporter --all
build-windows:
runs-on: windows-latest
strategy:
matrix:
java-version: [17, 20, 21, 22, 23, 24, 25]
steps:
- name: Configure git line endings
run: git config --global core.autocrlf input
- name: Checkout source repository
uses: actions/checkout@v7
with:
clean: true
submodules: "true"
fetch-depth: 0
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v5
with:
distribution: "corretto"
java-version: ${{ matrix.java-version }}
check-latest: true
- name: Cache bld dependencies
id: cache-bld
uses: actions/cache@v5
with:
path: lib
key: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
restore-keys: ${{ runner.os }}-bld-java${{ matrix.java-version}}-lib
- name: Compile source
run: .\bld.bat clean compile
- name: Run tests
id: tests
run: .\bld.bat test --reports-dir=${{ env.REPORTS_DIR }}
- name: Run reporter
if: always() && steps.tests.outcome == 'failure'
run: .\bld.bat --offline reporter --all

View file

@ -51,7 +51,7 @@ jobs:
- name: Publish - name: Publish
run: >- run: >-
./bld publish ./bld publish
-Dbld.repo.github=https://maven.pkg.github.com/rife2/bld-antlr4 -Dbld.repo.github=https://maven.pkg.github.com/rife2/bld
-Dbld.repo.github.username=${{ secrets.GH_USERNAME }} -Dbld.repo.github.username=${{ secrets.GH_USERNAME }}
-Dbld.repo.github.password=${{ secrets.GH_PASSWORD }} -Dbld.repo.github.password=${{ secrets.GH_PASSWORD }}
-Dbld.repo.rife2-snapshots=https://repo.rife2.com/snapshots/ -Dbld.repo.rife2-snapshots=https://repo.rife2.com/snapshots/
@ -65,4 +65,4 @@ jobs:
- name: Delete GnuPG data - name: Delete GnuPG data
if: always() if: always()
run: rm -rfv $HOME/.gnupg run: rm -rfv $HOME/.gnupg