From 8b98022a1721bbbd7abf42362b2c0403471e9b09 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Sun, 1 Dec 2024 14:06:58 +0100 Subject: [PATCH] Try fixing the publish step (#706) --- .github/workflows/continuous.yml | 49 ++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 5f6f2c78..367aba43 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -29,8 +29,23 @@ jobs: run: chmod +x gradlew - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + - name: Generate cache key + id: cache-key + run: | + key="${{ runner.os }}-gradle-1-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}" + echo "key=${key}" >> $GITHUB_ENV + echo "cache-key=${key}" >> $GITHUB_OUTPUT + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches/modules-2 + ~/.gradle/wrapper + key: ${{ env.key }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Build - run: ./gradlew build + run: ./gradlew --no-daemon --parallel --build-cache build - name: Upload dist build data if: always() uses: actions/upload-artifact@v4 @@ -55,6 +70,8 @@ jobs: name: test-reports path: | **/reports/**/* + outputs: + cache-key: ${{ steps.cache-key.outputs.cache-key }} test: needs: build @@ -83,6 +100,15 @@ jobs: echo 'n' | sdk install java ${{ matrix.java }} which java echo 'y' | sdk install java 11.0.25-tem + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches/modules-2 + ~/.gradle/wrapper + key: ${{ needs.build.outputs.cache-key }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Download build data uses: actions/download-artifact@v4 with: @@ -96,7 +122,9 @@ jobs: - name: Run tests run: | set +x - ./gradlew -Pintegration :integration-tests:test + ./gradlew --no-daemon --parallel --build-cache -Pintegration :integration-tests:test + - name: Check Gradle cache size + run: du -sh ~/.gradle/caches - name: Integration test reports if: always() uses: actions/upload-artifact@v4 @@ -114,7 +142,9 @@ jobs: publish: if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master' - needs: test + needs: + - test + - build runs-on: ubuntu-latest steps: - name: Checkout @@ -128,10 +158,19 @@ jobs: with: java-version: 11 distribution: temurin + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches/modules-2 + ~/.gradle/wrapper + key: ${{ needs.build.outputs.cache-key }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Download build data uses: actions/download-artifact@v4 with: - name: build + name: dist-build - name: Deploy Maven run: ./gradlew -x test :btrace-dist:publish env: @@ -147,4 +186,4 @@ jobs: - name: Cleanup temporary artifacts uses: geekyeggo/delete-artifact@v5 with: - name: build + name: dist-build