Skip to content

Commit

Permalink
GitHub actions - Separate cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
elahrvivaz committed Sep 20, 2024
1 parent c2a9d4f commit 60a6a49
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-compile-${{ inputs.scala.version }}
path: |
~/.m2/repository/
build/zinc-0.3.15/
- name: Set Scala version
run: ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
- name: Build with Maven
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-docs
path: ~/.m2/repository/
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.10'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/eclipse-dash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-dash
path: |
~/.m2/repository/
build/zinc-0.3.15/
- name: Build with Maven
run: ./build/mvn clean install $MAVEN_CLI_OPTS -DskipTests -T4
- name: License check
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-it-${{ inputs.scala.version }}
path: ~/.m2/repository/
- name: Set Scala version
run: |
echo ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
run: ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-compile-${{ inputs.scala.version }}
path: ~/.m2/repository/
- name: Run license check
run: mvn license:check $MAVEN_CLI_OPTS
14 changes: 9 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ jobs:
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Generate cache key
env:
MOD_SELECTOR: "${{ inputs.module-selector }}"
run: echo "MOD_SELECTOR=\"${MOD_SELECTOR// /}\"" >> $GITHUB_ENV
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
key: ${{ hashFiles('**/pom.xml') }}-unit-tests-${{ inputs.scala.version }}-${{ env.MOD_SELECTOR }}
path: ~/.m2/repository/
- name: Set Scala version
run: |
echo ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
run: ./build/scripts/change-scala-version.sh ${{ inputs.scala-version }}
- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand All @@ -42,7 +47,6 @@ jobs:
continue-on-error: true
run: |
set -o pipefail
echo mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS ${{ inputs.module-selector }}
mvn surefire:test $MAVEN_CLI_OPTS $MAVEN_TEST_OPTS ${{ inputs.module-selector }} | tee -a test.log
- name: Unit tests (retry)
id: test-retry
Expand Down

0 comments on commit 60a6a49

Please sign in to comment.