diff options
author | Kristóf Marussy <kristof@marussy.com> | 2024-04-07 13:04:59 +0200 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2024-04-07 14:42:15 +0200 |
commit | be3c99ac642361e3f0365974354cf3f2bb90c532 (patch) | |
tree | cc82c3e9167d94b239af0d6b9873b798e3c9358c | |
parent | chore(deps): bump dependencies (diff) | |
download | refinery-be3c99ac642361e3f0365974354cf3f2bb90c532.tar.gz refinery-be3c99ac642361e3f0365974354cf3f2bb90c532.tar.zst refinery-be3c99ac642361e3f0365974354cf3f2bb90c532.zip |
build: multi-platform build
-rw-r--r-- | .github/workflows/build.yml | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d57d565..c7d7b2e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml | |||
@@ -1,4 +1,4 @@ | |||
1 | # SPDX-FileCopyrightText: 2021-2023 The Refinery Authors | 1 | # SPDX-FileCopyrightText: 2021-2024 The Refinery Authors |
2 | # | 2 | # |
3 | # SPDX-License-Identifier: EPL-2.0 | 3 | # SPDX-License-Identifier: EPL-2.0 |
4 | 4 | ||
@@ -13,10 +13,19 @@ on: | |||
13 | jobs: | 13 | jobs: |
14 | build: | 14 | build: |
15 | name: Build | 15 | name: Build |
16 | runs-on: ubuntu-latest | 16 | strategy: |
17 | matrix: | ||
18 | os: | ||
19 | - ubuntu-latest | ||
20 | - ubuntu-20.04 | ||
21 | - windows-latest | ||
22 | - macos-13 # Intel | ||
23 | - macos-14 # ARM | ||
24 | runs-on: ${{ matrix.os }} | ||
17 | steps: | 25 | steps: |
18 | - name: Check for Sonar secret | 26 | - name: Check for Sonar secret |
19 | id: check-secret | 27 | id: check-secret |
28 | if: ${{ matrix.os == 'ubuntu-latest' }} | ||
20 | env: | 29 | env: |
21 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | 30 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
22 | run: | | 31 | run: | |
@@ -24,59 +33,59 @@ jobs: | |||
24 | echo 'is_SONAR_TOKEN_set=true' >> $GITHUB_OUTPUT | 33 | echo 'is_SONAR_TOKEN_set=true' >> $GITHUB_OUTPUT |
25 | fi | 34 | fi |
26 | - name: Checkout code | 35 | - name: Checkout code |
27 | uses: actions/checkout@v3 | 36 | uses: actions/checkout@v4 |
28 | with: | 37 | with: |
29 | fetch-depth: ${{ !steps.check-secret.outputs.is_SONAR_TOKEN_set && 1 || 0 }} # Shallow clones should be disabled for a better relevancy of SonarCloud analysis | 38 | fetch-depth: ${{ !steps.check-secret.outputs.is_SONAR_TOKEN_set && 1 || 0 }} # Shallow clones should be disabled for a better relevancy of SonarCloud analysis |
30 | - name: Set up JDK 21 | 39 | - name: Set up JDK 21 |
31 | uses: actions/setup-java@v3 | 40 | uses: actions/setup-java@v4 |
32 | with: | 41 | with: |
33 | java-version: 21 | 42 | java-version: 21 |
34 | distribution: temurin | 43 | distribution: corretto |
35 | - name: Cache Gradle packages | 44 | - name: Cache Gradle packages |
36 | uses: actions/cache@v3 | 45 | uses: actions/cache@v4 |
37 | with: | 46 | with: |
38 | path: | | 47 | path: | |
39 | ~/.gradle/caches | 48 | ~/.gradle/caches |
40 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }} | 49 | key: ${{ matrix.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }} |
41 | restore-keys: ${{ runner.os }}-gradle | 50 | restore-keys: ${{ matrix.os }}-gradle |
42 | - name: Cache Sonar packages | 51 | - name: Cache Sonar packages |
43 | uses: actions/cache@v3 | 52 | uses: actions/cache@v4 |
44 | if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }} | 53 | if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }} |
45 | with: | 54 | with: |
46 | path: | | 55 | path: | |
47 | ~/.sonar/cache | 56 | ~/.sonar/cache |
48 | key: ${{ runner.os }}-sonar | 57 | key: ${{ matrix.os }}-sonar |
49 | restore-keys: ${{ runner.os }}-sonar | 58 | restore-keys: ${{ matrix.os }}-sonar |
50 | - name: Cache node distribution | 59 | - name: Cache node distribution |
51 | uses: actions/cache@v3 | 60 | uses: actions/cache@v4 |
52 | with: | 61 | with: |
53 | path: | | 62 | path: | |
54 | **/.node | 63 | **/.node |
55 | key: ${{ runner.os }}-node-${{ hashFiles('gradle.properties') }} | 64 | key: ${{ matrix.os }}-node-${{ hashFiles('gradle.properties') }} |
56 | restore-keys: ${{ runner.os }}-node | 65 | restore-keys: ${{ matrix.os }}-node |
57 | - name: Cache yarn packages | 66 | - name: Cache yarn packages |
58 | uses: actions/cache@v3 | 67 | uses: actions/cache@v4 |
59 | with: | 68 | with: |
60 | path: | | 69 | path: | |
61 | **/.yarn/cache | 70 | **/.yarn/cache |
62 | key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | 71 | key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
63 | restore-keys: ${{ runner.os }}-yarn | 72 | restore-keys: ${{ matrix.os }}-yarn |
64 | - name: Gradle build | 73 | - name: Gradle build |
65 | run: | | 74 | run: | |
66 | ./gradlew build -Pci --info | 75 | ./gradlew build -Pci --info --stacktrace --max-workers 4 --no-daemon |
67 | - name: Sonar analyze | 76 | - name: Sonar analyze |
68 | if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }} | 77 | if: ${{ steps.check-secret.outputs.is_SONAR_TOKEN_set }} |
69 | env: | 78 | env: |
70 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed by Sonar to get PR information, if any | 79 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed by Sonar to get PR information, if any |
71 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | 80 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
72 | run: | | 81 | run: | |
73 | ./gradlew sonar -Pci --info | 82 | ./gradlew sonar -Pci --info --stacktrace --max-workers 4 --no-daemon |
74 | reuse-check: | 83 | reuse-check: |
75 | name: REUSE Compliance Check | 84 | name: REUSE Compliance Check |
76 | runs-on: ubuntu-latest | 85 | runs-on: ubuntu-latest |
77 | steps: | 86 | steps: |
78 | - uses: actions/checkout@v3 | 87 | - uses: actions/checkout@v4 |
79 | - name: REUSE Compliance Check | 88 | - name: REUSE Compliance Check |
80 | uses: fsfe/reuse-action@v1 | 89 | uses: fsfe/reuse-action@a46482ca367aef4454a87620aa37c2be4b2f8106 |
81 | with: | 90 | with: |
82 | args: --include-meson-subprojects lint | 91 | args: --include-meson-subprojects lint |