From 21b202ec2009272953f413c0e85d73d41abc98f1 Mon Sep 17 00:00:00 2001 From: Ming Wang Date: Tue, 5 Dec 2023 09:36:26 -0500 Subject: [PATCH] checkout core first to cache --- .github/workflows/ci.yml | 20 ++++++++++++-------- .github/workflows/cryostat-test.yml | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6238f731..9e34ed90 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,22 +65,26 @@ jobs: sudo apt-get install -y qemu-user-static - uses: actions/checkout@v4 with: - repository: ${{ github.repository_owner }}/cryostat - ref: main - submodules: true + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - uses: actions/cache@v3 with: path: ~/.m2 key: ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }} restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }} ${{ runner.os }}-build- ${{ runner.os }}- + - uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/cryostat + ref: main + submodules: true + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' - name: maven-settings uses: s4u/maven-settings-action@v2 with: diff --git a/.github/workflows/cryostat-test.yml b/.github/workflows/cryostat-test.yml index 1878a3d5..bbe033d3 100644 --- a/.github/workflows/cryostat-test.yml +++ b/.github/workflows/cryostat-test.yml @@ -75,22 +75,26 @@ jobs: steps: - uses: actions/checkout@v4 with: - repository: ${{ github.repository_owner }}/cryostat - ref: main - submodules: true + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - uses: actions/cache@v3 with: path: ~/.m2 key: ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }} restore-keys: | - ${{ runner.os }}-build-${{ hashFiles('**/pom.xml') }} ${{ runner.os }}-build- ${{ runner.os }}- + - uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/cryostat + ref: main + submodules: true + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' - name: maven-settings uses: s4u/maven-settings-action@v2 with: