Update Copyright (Company name) #175
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: build-action | |
on: | |
push: | |
branches-ignore: | |
- 'gh-pages' | |
pull_request: | |
branches-ignore: | |
- 'gh-pages' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, windows-latest] | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Check repository | |
uses: actions/checkout@v4 | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
#Run only on macOS | |
- name: Setup Docker on macOS | |
if: ${{ matrix.os == 'macos-13' && github.event_name == 'pull_request' }} | |
uses: douglascamata/setup-docker-macos-action@v1-alpha | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- name: Cache SonarQube packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
#Build without test on Windows or macOS (when not a PR) | |
- name: Gradle build | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_CLOUD_ORGANIZATION: ${{ vars.SONAR_CLOUD_ORGANIZATION }} | |
SONAR_CLOUD_PROJECT_KEY: ${{ vars.SONAR_CLOUD_PROJECT_KEY }} | |
SONAR_CLOUD_PROJECT_NAME: ${{ vars.SONAR_CLOUD_PROJECT_NAME }} | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" || ( "$RUNNER_OS" == "macOS" && ${{ github.event_name }} != 'pull_request' ) ]]; then | |
./gradlew build -x test | |
elif [[ ${{ github.event_name }} == 'pull_request' && ${{ github.event.pull_request.head.repo.full_name != 'eclipse-hara/hara-ddiclient' }} ]]; then | |
./gradlew --info build | |
else | |
./gradlew --info build sonar | |
fi | |
shell: bash | |