Merge pull request #206 from AuraDevelopmentTeam/dependabot/github_ac… #60
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Checks | |
on: [push, pull_request] | |
env: | |
GRADLE_OPTS: >- | |
-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false | |
GRADLE_CMD_OPTS: >- | |
-PbranchName="${{ github.ref }}" | |
--console=plain | |
--continue | |
--no-build-cache | |
--no-daemon | |
--parallel | |
jobs: | |
spotless: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
java-package: jdk | |
distribution: 'temurin' | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- name: Check code formatting | |
run: ./gradlew ${{ env.GRADLE_CMD_OPTS }} spotlessCheck | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
java-package: jdk | |
distribution: 'temurin' | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
- uses: burrunan/gradle-cache-action@v2 | |
name: Cache .gradle | |
with: | |
# Disable caching of $HOME/.gradle/caches/*.*/generated-gradle-jars | |
save-generated-gradle-jars: false | |
# Disable caching of ~/.gradle/caches/build-cache-* | |
save-local-build-cache: false | |
# Enable caching of ~/.gradle/caches/modules-* | |
save-gradle-dependencies-cache: true | |
# Enable caching of ~/.m2/repository/ | |
save-maven-dependencies-cache: true | |
- name: Build all files | |
run: ./gradlew ${{ env.GRADLE_CMD_OPTS }} assemble compileTest | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
needs: [build] | |
steps: | |
- run: | | |
ref="${github_ref////-}" | |
echo "ref=$ref" >> $GITHUB_ENV | |
env: | |
github_ref: ${{ github.ref }} | |
shell: bash | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
java-package: jdk | |
distribution: 'temurin' | |
- name: Checkout submodules | |
run: git submodule update --init --recursive | |
# This is to ensure unit tests with MariaDB4j don't fail | |
- name: Install OpenSSL 1.0.2 | |
if: ${{ runner.os == 'MacOS' }} | |
run: | | |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
arch -x86_64 /usr/local/bin/brew install rbenv/tap/openssl@1.0 | |
sudo ln -sfnv /usr/local/Cellar/openssl@1.0/1.0.2* /usr/local/opt/openssl | |
# This is to ensure unit tests with MariaDB4j don't fail | |
- name: Install libncurses5 | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get install -y libncurses5 | |
- uses: burrunan/gradle-cache-action@v2 | |
name: Cache .gradle | |
with: | |
# Disable caching of $HOME/.gradle/caches/*.*/generated-gradle-jars | |
save-generated-gradle-jars: false | |
# Disable caching of ~/.gradle/caches/build-cache-* | |
save-local-build-cache: false | |
# Enable caching of ~/.gradle/caches/modules-* | |
save-gradle-dependencies-cache: true | |
# Enable caching of ~/.m2/repository/ | |
save-maven-dependencies-cache: true | |
- name: Run all Tests | |
id: gradle_tests | |
run: ./gradlew ${{ env.GRADLE_CMD_OPTS }} -x spotlessCheck build | |
- uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: ${{ env.ref }}_code-checks_${{ matrix.os }} | |
path: | | |
**/build/test-results/test/TEST-*.xml | |
**/build/reports/spotbugs/*.xml |