Skip to content

Commit

Permalink
Exclude Dagger local snapshots from Maven local repo cache.
Browse files Browse the repository at this point in the history
This prevents the LOCAL-SNAPSHOT artifacts from being cached with the rest of the `.m2/repository` directory which in turn would cause other jobs to fail due to not using the local snapshots built for the workflow. Instead use the upload and download actions to share the artifacts between jobs.

RELNOTES=N/A
PiperOrigin-RevId: 354200073
  • Loading branch information
danysantiago authored and Dagger Team committed Jan 28, 2021
1 parent 98c73c6 commit 229c99f
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
- name: 'Cache local Maven repository'
uses: actions/cache@v2
with:
path: ~/.m2/repository
path: |
~/.m2/repository
!~/.m2/repository/com/google/dagger
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
Expand All @@ -26,20 +28,23 @@ jobs:
- name: 'Install local snapshot'
run: ./util/install-local-snapshot.sh
shell: bash
- name: 'Upload local snapshot for tests'
uses: actions/upload-artifact@v2
with:
name: local-snapshot
path: ~/.m2/repository/com/google/dagger
artifact-local-tests:
name: 'Artifact local tests'
needs: bazel-test
runs-on: ubuntu-latest
steps:
- name: 'Check out repository'
uses: actions/checkout@v2
- name: 'Cache local Maven repository'
uses: actions/cache@v2
- name: 'Download local snapshot for tests'
uses: actions/download-artifact@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
name: local-snapshot
path: ~/.m2/repository/com/google/dagger
- name: 'Gradle tests'
run: ./util/run-local-gradle-tests.sh
shell: bash
Expand All @@ -53,13 +58,11 @@ jobs:
steps:
- name: 'Check out repository'
uses: actions/checkout@v2
- name: 'Cache local Maven repository'
uses: actions/cache@v2
- name: 'Download local snapshot for tests'
uses: actions/download-artifact@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
name: local-snapshot
path: ~/.m2/repository/com/google/dagger
- name: 'Gradle Android tests (AGP ${{ matrix.agp }})'
run: ./util/run-local-gradle-android-tests.sh "${{ matrix.agp }}"
shell: bash
Expand Down

0 comments on commit 229c99f

Please sign in to comment.