108 lines
3.7 KiB
YAML
108 lines
3.7 KiB
YAML
# 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.
|
|
|
|
name: Hibernate ORM build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
|
|
# 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' }}
|
|
|
|
jobs:
|
|
build:
|
|
name: Java 11
|
|
runs-on: ubuntu-latest
|
|
# We want to know the test results of all matrix entries
|
|
continue-on-error: true
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# 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
|
|
include:
|
|
- rdbms: h2
|
|
experimental: false
|
|
- rdbms: hsqldb
|
|
experimental: false
|
|
- rdbms: derby
|
|
experimental: false
|
|
- rdbms: mysql8
|
|
experimental: false
|
|
- rdbms: mariadb
|
|
experimental: false
|
|
- rdbms: postgresql_9_5
|
|
experimental: false
|
|
- rdbms: postgresql_13
|
|
experimental: false
|
|
- rdbms: oracle
|
|
experimental: false
|
|
- rdbms: db2
|
|
experimental: false
|
|
- rdbms: mssql
|
|
experimental: false
|
|
- rdbms: sybase
|
|
experimental: false
|
|
# 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
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Reclaim Disk Space
|
|
run: .github/ci-prerequisites.sh
|
|
- name: Start database
|
|
env:
|
|
RDBMS: ${{ matrix.rdbms }}
|
|
run: ci/database-start.sh
|
|
- name: Set up Java 11
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '11'
|
|
- 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
|
|
env:
|
|
RDBMS: ${{ matrix.rdbms }}
|
|
run: ./ci/build-github.sh
|
|
shell: bash
|
|
- name: Upload test reports (if Gradle failed)
|
|
uses: actions/upload-artifact@v2
|
|
if: failure()
|
|
with:
|
|
name: test-reports-java11-${{ matrix.rdbms }}
|
|
path: |
|
|
./**/target/reports/tests/
|
|
./**/target/reports/checkstyle/
|
|
- name: Omit produced artifacts from build cache
|
|
run: ./ci/before-cache.sh
|