From 653f67768ef27ec41963c5adf41c930aa37d9580 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Tue, 13 Aug 2024 09:05:29 +0200 Subject: [PATCH] Aligning the JS build and caching with the main build (#31846) Closes #31845 Signed-off-by: Alexander Schwartz --- .github/actions/pnpm-setup/action.yml | 13 +++++-------- .github/workflows/js-ci.yml | 22 +++++----------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/actions/pnpm-setup/action.yml b/.github/actions/pnpm-setup/action.yml index b0b5e893f3..5a0188eb69 100644 --- a/.github/actions/pnpm-setup/action.yml +++ b/.github/actions/pnpm-setup/action.yml @@ -7,11 +7,6 @@ inputs: required: false default: "20" - working-directory: - description: The working directory where the `pnpm-lock.yaml` file is located. - required: false - default: "" - runs: using: composite steps: @@ -38,11 +33,13 @@ runs: path: | ~/.cache/Cypress ${{ steps.pnpm-cache.outputs.store-path }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('${{ inputs.working-directory }}/pnpm-lock.yaml') }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install dependencies - working-directory: ${{ inputs.working-directory }} shell: bash - run: pnpm install --prefer-offline --frozen-lockfile + # Run the store prune after the installation to avoid having caches which grow over time + run: | + pnpm install --prefer-offline --frozen-lockfile + pnpm store prune diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index b61c99e1e7..53c930fbe4 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -43,17 +43,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - check-latest: true - cache: maven - - name: Build Keycloak + uses: ./.github/actions/build-keycloak + + - name: Prepare archive for upload run: | - ./mvnw clean install --errors -DskipTests -DskipTestsuite -DskipExamples -Pdistribution mv ./quarkus/dist/target/keycloak-999.0.0-SNAPSHOT.tar.gz ./keycloak-999.0.0-SNAPSHOT.tar.gz - name: Upload Keycloak dist @@ -164,10 +158,7 @@ jobs: name: keycloak - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 + uses: ./.github/actions/java-setup - name: Start Keycloak server run: | @@ -258,10 +249,7 @@ jobs: name: keycloak - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 + uses: ./.github/actions/java-setup - name: Start Keycloak server run: |