2020-11-19 09:50:16 -05:00
|
|
|
# The main CI of Hibernate ORM is https://ci.hibernate.org/job/hibernate-orm-6.0-h2-main/.
|
|
|
|
# However, Hibernate ORM builds run on GitHub actions regularly
|
|
|
|
# to check that it still works and can be used in GitHub forks.
|
|
|
|
# See https://docs.github.com/en/free-pro-team@latest/actions
|
|
|
|
# for more information about GitHub actions.
|
|
|
|
|
2020-11-26 10:19:08 -05:00
|
|
|
name: Hibernate ORM build
|
2020-11-19 09:50:16 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-03-19 11:59:03 -04:00
|
|
|
- 'main'
|
2020-11-19 09:50:16 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-03-19 11:59:03 -04:00
|
|
|
- 'main'
|
2022-01-10 07:46:54 -05:00
|
|
|
|
|
|
|
# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
|
|
|
|
concurrency:
|
|
|
|
# Consider that two builds are in the same concurrency group (cannot run concurrently)
|
|
|
|
# if they use the same workflow and are about the same branch ("ref") or pull request.
|
|
|
|
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
|
|
|
|
# Cancel previous builds in the same concurrency group even if they are in process
|
|
|
|
# for pull requests or pushes to forks (not the upstream repository).
|
|
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-orm' }}
|
|
|
|
|
2020-11-19 09:50:16 -05:00
|
|
|
jobs:
|
|
|
|
build:
|
2021-12-01 06:31:29 -05:00
|
|
|
name: Java 11
|
2020-11-19 09:50:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-26 10:19:08 -05:00
|
|
|
# We want to know the test results of all matrix entries
|
|
|
|
continue-on-error: true
|
2020-11-19 09:50:16 -05:00
|
|
|
strategy:
|
2020-11-26 10:19:08 -05:00
|
|
|
fail-fast: false
|
2020-11-19 09:50:16 -05:00
|
|
|
matrix:
|
2020-11-26 10:19:08 -05:00
|
|
|
# When GitHub Actions supports it: https://github.com/actions/toolkit/issues/399
|
|
|
|
# We will use the experimental flag as indicator whether a failure should cause a workflow failure
|
2020-11-19 09:50:16 -05:00
|
|
|
include:
|
|
|
|
- rdbms: h2
|
2020-11-26 10:19:08 -05:00
|
|
|
experimental: false
|
2021-06-23 08:56:57 -04:00
|
|
|
- rdbms: hsqldb
|
|
|
|
experimental: false
|
2020-11-19 09:50:16 -05:00
|
|
|
- rdbms: derby
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2021-07-06 06:55:10 -04:00
|
|
|
- rdbms: mysql8
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2020-11-19 09:50:16 -05:00
|
|
|
- rdbms: mariadb
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2021-08-31 04:06:37 -04:00
|
|
|
- rdbms: postgresql_9_5
|
|
|
|
experimental: false
|
|
|
|
- rdbms: postgresql_13
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2020-11-19 09:50:16 -05:00
|
|
|
- rdbms: oracle
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2020-11-19 09:50:16 -05:00
|
|
|
- rdbms: db2
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
2020-11-19 09:50:16 -05:00
|
|
|
- rdbms: mssql
|
2021-06-23 08:56:57 -04:00
|
|
|
experimental: false
|
|
|
|
- rdbms: sybase
|
|
|
|
experimental: false
|
2021-04-06 08:24:13 -04:00
|
|
|
# Running with HANA requires at least 8GB memory just for the database, which we don't have on GH Actions runners
|
|
|
|
# - rdbms: hana
|
|
|
|
# experimental: true
|
2020-11-19 09:50:16 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-04-06 08:24:13 -04:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2021-02-09 07:03:18 -05:00
|
|
|
- name: Reclaim Disk Space
|
|
|
|
run: .github/ci-prerequisites.sh
|
2021-04-06 08:24:13 -04:00
|
|
|
- name: Start database
|
|
|
|
env:
|
|
|
|
RDBMS: ${{ matrix.rdbms }}
|
|
|
|
run: ci/database-start.sh
|
2020-11-19 09:50:16 -05:00
|
|
|
- name: Set up Java 11
|
2021-12-01 09:54:59 -05:00
|
|
|
uses: actions/setup-java@v2
|
2020-11-19 09:50:16 -05:00
|
|
|
with:
|
2021-12-01 09:54:59 -05:00
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: '11'
|
2020-11-19 09:50:16 -05:00
|
|
|
- name: Get year/month for cache key
|
|
|
|
id: get-date
|
|
|
|
run: |
|
|
|
|
echo "::set-output name=yearmonth::$(/bin/date -u "+%Y-%m")"
|
|
|
|
shell: bash
|
|
|
|
- name: Cache Maven local repository
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache-maven
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.m2/repository
|
|
|
|
~/.gradle/caches/
|
|
|
|
~/.gradle/wrapper/
|
|
|
|
# refresh cache every month to avoid unlimited growth
|
|
|
|
key: maven-localrepo-${{ steps.get-date.outputs.yearmonth }}
|
|
|
|
- name: Run build script
|
2021-12-01 06:31:29 -05:00
|
|
|
env:
|
|
|
|
RDBMS: ${{ matrix.rdbms }}
|
2020-11-26 10:19:08 -05:00
|
|
|
run: ./ci/build-github.sh
|
2020-11-19 09:50:16 -05:00
|
|
|
shell: bash
|
|
|
|
- name: Upload test reports (if Gradle failed)
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
2021-12-01 06:31:29 -05:00
|
|
|
name: test-reports-java11-${{ matrix.rdbms }}
|
2021-02-03 04:55:07 -05:00
|
|
|
path: |
|
|
|
|
./**/target/reports/tests/
|
|
|
|
./**/target/reports/checkstyle/
|
2020-11-19 09:50:16 -05:00
|
|
|
- name: Omit produced artifacts from build cache
|
2021-04-06 08:24:13 -04:00
|
|
|
run: ./ci/before-cache.sh
|