aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-02-04 20:18:20 +0100
committerLibravatar GitHub <noreply@github.com>2022-02-04 20:18:20 +0100
commit42db1e8b4dcff3667c5f14e8dd464309c3c2f23e (patch)
treef5f5efe86fb352980cf144cceb68d1a1101b274f /.github/workflows/build.yml
parentchore(web): fix Sonar issue (diff)
parentchore(frontend): bump frontend dependencies (diff)
downloadrefinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.gz
refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.zst
refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.zip
Merge pull request #18 from kris7t/releng-docs
Restructure project
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml40
1 files changed, 28 insertions, 12 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 1fa16a43..de55ffcf 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,7 +2,8 @@ name: Build
2on: 2on:
3 push: 3 push:
4 branches: 4 branches:
5 - main 5 - '**'
6 - '!gh-pages'
6 pull_request: 7 pull_request:
7 types: [opened, synchronize, reopened] 8 types: [opened, synchronize, reopened]
8jobs: 9jobs:
@@ -10,10 +11,16 @@ jobs:
10 name: Build 11 name: Build
11 runs-on: ubuntu-latest 12 runs-on: ubuntu-latest
12 steps: 13 steps:
14 - name: Check for Sonar secret
15 id: check-secret
16 env:
17 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
18 run: |
19 echo "::set-output name=is_SONAR_TOKEN_set::${{ env.SONAR_TOKEN != '' }}"
13 - name: Checkout code 20 - name: Checkout code
14 uses: actions/checkout@v2 21 uses: actions/checkout@v2
15 with: 22 with:
16 fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of SonarCloud analysis 23 fetch-depth: ${{ !steps.check-secret.is_SONAR_TOKEN_set && 1 || 0 }} # Shallow clones should be disabled for a better relevancy of SonarCloud analysis
17 - name: Set up JDK 17 24 - name: Set up JDK 17
18 uses: actions/setup-java@v1 25 uses: actions/setup-java@v1
19 with: 26 with:
@@ -23,29 +30,38 @@ jobs:
23 with: 30 with:
24 path: | 31 path: |
25 ~/.gradle/caches 32 ~/.gradle/caches
26 .gradle/node 33 key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle', 'gradle.properties', 'gradle/libs.versions.toml', 'gradle/wrapper/gradle-wrapper.properties') }}
27 .gradle/yarn
28 key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
29 restore-keys: ${{ runner.os }}-gradle 34 restore-keys: ${{ runner.os }}-gradle
30 - name: Cache Sonar packages 35 - name: Cache Sonar packages
31 uses: actions/cache@v2 36 uses: actions/cache@v2
37 if: ${{ steps.check-secret.is_SONAR_TOKEN_set }}
32 with: 38 with:
33 path: ~/.sonar/cache 39 path: |
40 ~/.sonar/cache
34 key: ${{ runner.os }}-sonar 41 key: ${{ runner.os }}-sonar
35 restore-keys: ${{ runner.os }}-sonar 42 restore-keys: ${{ runner.os }}-sonar
43 - name: Cache node distribution
44 uses: actions/cache@v2
45 with:
46 path: |
47 **/.node
48 key: ${{ runner.os }}-node-${{ hashFiles('gradle.properties') }}
49 restore-keys: ${{ runner.os }}-node
36 - name: Cache yarn packages 50 - name: Cache yarn packages
37 uses: actions/cache@v2 51 uses: actions/cache@v2
38 with: 52 with:
39 path: | 53 path: |
40 **/node_modules 54 **/.yarn/cache
41 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} 55 key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42 restore-keys: ${{ runner.os }}-yarn 56 restore-keys: ${{ runner.os }}-yarn
57 - name: Gradle build
58 if: ${{ !steps.check-secret.is_SONAR_TOKEN_set }}
59 run: |
60 ./gradlew build -Pci --info
43 - name: Gradle build and Sonar analyze 61 - name: Gradle build and Sonar analyze
44 if: ${{ github.event_name != 'pull_request' }} 62 if: ${{ steps.check-secret.is_SONAR_TOKEN_set }}
45 env: 63 env:
46 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed by Sonar to get PR information, if any 64 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed by Sonar to get PR information, if any
47 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 65 SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
48 run: ./gradlew build sonarqube -Pci --info 66 run: |
49 - name: Gradle build for pull request 67 ./gradlew build sonarqube -Pci --info
50 if: ${{ github.event_name == 'pull_request' }}
51 run: ./gradlew build --info