Skip to content

Commit

Permalink
build: multi-platform build
Browse files Browse the repository at this point in the history
  • Loading branch information
kris7t committed Apr 7, 2024
1 parent 7f871fa commit fa68ee6
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- windows-latest
- macos-13 # Intel
- macos-14 # ARM
runs-on: ${{ matrix.os }}
steps:
- name: Check for Sonar secret
id: check-secret
if: ${{ matrix.os == 'ubuntu-latest' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
Expand All @@ -31,46 +40,46 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
distribution: corretto
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle
key: ${{ matrix.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: ${{ matrix.os }}-gradle
- name: Cache Sonar packages
uses: actions/cache@v3
if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }}
with:
path: |
~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
key: ${{ matrix.os }}-sonar
restore-keys: ${{ matrix.os }}-sonar
- name: Cache node distribution
uses: actions/cache@v3
with:
path: |
**/.node
key: ${{ runner.os }}-node-${{ hashFiles('gradle.properties') }}
restore-keys: ${{ runner.os }}-node
key: ${{ matrix.os }}-node-${{ hashFiles('gradle.properties') }}
restore-keys: ${{ matrix.os }}-node
- name: Cache yarn packages
uses: actions/cache@v3
with:
path: |
**/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ matrix.os }}-yarn
- name: Gradle build
run: |
./gradlew build -Pci --info
./gradlew build -Pci --info --stacktrace --max-workers 4 --no-daemon
- name: Sonar analyze
if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed by Sonar to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
./gradlew sonar -Pci --info
./gradlew sonar -Pci --info --stacktrace --max-workers 4 --no-daemon
reuse-check:
name: REUSE Compliance Check
runs-on: ubuntu-latest
Expand Down

0 comments on commit fa68ee6

Please sign in to comment.