|
| 1 | +name: GitHub Actions Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + types: [opened, synchronize, reopened, ready_for_review] |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" |
| 10 | + cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-github-bot-playground' }} |
| 11 | + |
| 12 | +defaults: |
| 13 | + run: |
| 14 | + shell: bash |
| 15 | + |
| 16 | +env: |
| 17 | + MAVEN_ARGS: "-e -B --fail-at-end" |
| 18 | + |
| 19 | +jobs: |
| 20 | + build: |
| 21 | + name: ${{matrix.os.name}} |
| 22 | + runs-on: ${{ matrix.os.runs-on }} |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: |
| 27 | + - { |
| 28 | + name: "Linux JDK 17", |
| 29 | + runs-on: 'ubuntu-latest', |
| 30 | + java: { |
| 31 | + version: 17 |
| 32 | + } |
| 33 | + } |
| 34 | + # We can't start Linux containers on GitHub Actions' Windows VMs, |
| 35 | + # so we can't run Elasticsearch tests. |
| 36 | + # See https://github.com/actions/runner-images/issues/1143#issuecomment-972929995 |
| 37 | + - { |
| 38 | + name: "Windows JDK 17", |
| 39 | + runs-on: 'windows-latest', |
| 40 | + java: { |
| 41 | + version: 17 |
| 42 | + } |
| 43 | + } |
| 44 | + steps: |
| 45 | + - name: Support longpaths on Windows |
| 46 | + if: "startsWith(matrix.os.runs-on, 'windows')" |
| 47 | + run: git config --global core.longpaths true |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + with: |
| 50 | + # Fetch the whole history to make sure that gitflow incremental builder |
| 51 | + # can find the base commit. |
| 52 | + fetch-depth: 0 |
| 53 | + - name: Set up Java ${{ matrix.os.java.version }} |
| 54 | + uses: actions/setup-java@v4 |
| 55 | + with: |
| 56 | + java-version: ${{ matrix.os.java.version }} |
| 57 | + distribution: temurin |
| 58 | + - name: Set up Maven |
| 59 | + run: ./mvnw -v |
| 60 | + - name: Building code and running unit tests and basic checks |
| 61 | + run: | |
| 62 | + ./mvnw $MAVEN_ARGS ${{ matrix.os.maven.args }} clean install \ |
| 63 | + -Pjqassistant -Pdist -Pci-build -DskipITs |
| 64 | + env: |
| 65 | + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} |
| 66 | + - name: Running integration tests in the default environment |
| 67 | + run: | |
| 68 | + ./mvnw $MAVEN_ARGS ${{ matrix.os.maven.args }} clean verify \ |
| 69 | + -Pskip-checks \ |
| 70 | + ${{ github.event.pull_request.base.ref && format('-Dincremental -Dgib.referenceBranch=refs/remotes/origin/{0}', github.event.pull_request.base.ref) || '' }} |
| 71 | + env: |
| 72 | + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} |
0 commit comments