4848 include :
4949 - os : ubuntu-latest
5050 repo-cache-path : ' ~/.m2/repository'
51- mvnd-cache-path : ' ~/.mvnd'
5251 - os : windows-latest
5352 repo-cache-path : ' ~\.m2\repository'
54- mvnd-cache-path : ' ~\.mvnd'
5553
5654 env :
5755 MVND_VERSION : ' 1.0.3'
@@ -74,33 +72,21 @@ jobs:
7472 restore-keys : |
7573 maven-${{ runner.os }}-
7674
77- - name : Cache mvnd [${{ runner.os }}]
78- id : cache-mvnd
75+ - name : Cache mvnd [Linux]
7976 uses : actions/cache@v4
77+ if : runner.os == 'Linux'
8078 with :
81- path : ${{ matrix .mvnd-cache-path }}
82- key : mvnd-${{ env.MVND_VERSION }}-${{ runner.os }}
79+ path : ~/ .mvnd
80+ key : mvnd-${{ env.MVND_VERSION }}-linux
8381
8482 - name : Install mvnd [Linux]
85- if : steps.cache-mvnd.outputs.cache-hit != 'true' && runner.os == 'Linux'
83+ if : runner.os == 'Linux'
8684 shell : bash
8785 run : |
8886 curl -fsSL https://github.com/apache/maven-mvnd/releases/download/${{ env.MVND_VERSION }}/maven-mvnd-${{ env.MVND_VERSION }}-linux-amd64.tar.gz | tar xz
8987 mkdir -p ~/.mvnd
9088 mv maven-mvnd-${{ env.MVND_VERSION }}-linux-amd64/* ~/.mvnd/
9189
92- - name : Install mvnd [Windows]
93- if : steps.cache-mvnd.outputs.cache-hit != 'true' && runner.os == 'Windows'
94- shell : pwsh
95- run : |
96- Invoke-WebRequest `
97- -Uri "https://github.com/apache/maven-mvnd/releases/download/${{ env.MVND_VERSION }}/maven-mvnd-${{ env.MVND_VERSION }}-windows-amd64.zip" `
98- -OutFile "mvnd.zip"
99- mkdir -Path "~\.mvnd" -Force
100- Expand-Archive -Path "mvnd.zip" -DestinationPath "mvnd" -FORCE
101- Copy-Item -Path "mvnd\maven-mvnd-${{ env.MVND_VERSION }}-windows-amd64\*" -Destination "~\.mvnd\" -Recurse
102- Remove-Item -Path "mvnd", "mvnd.zip" -Recurse -Force
103-
10490 - name : Build and Test with Coverage [Linux]
10591 if : runner.os == 'Linux'
10692 run : |
10995
11096 - name : Build and Test with Coverage [Windows]
11197 if : runner.os == 'Windows'
98+ shell : pwsh
11299 run : |
113- & "~\.mvnd\bin\mvnd.cmd" -B clean verify
100+ mvn -B clean verify
114101
115102 - name : Upload coverage reports to Codecov
116103 if : runner.os == 'Linux'
0 commit comments