mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-16 00:00:14 +08:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c4f3ff3dc | |||
| e435effde6 | |||
| e97b30e967 | |||
| ae19451abc | |||
| 6d44c18d67 | |||
| 9f3d803b4e | |||
| 023b47f3ae | |||
| 5257c30aee | |||
| 88b5bc7548 | |||
| 6c5362973d | |||
| f8353fecf3 | |||
| 9337884575 | |||
| c6cceea941 | |||
| fa2c7e4517 | |||
| 78d72295d8 | |||
| 5727e29093 |
39
.github/workflows/test.yml
vendored
39
.github/workflows/test.yml
vendored
@ -18,8 +18,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||||
java: [ '8', '11', '17' ]
|
java: [ '8', '11', '17', '21' ]
|
||||||
maven: [ '3.8.8', '3.9.4' ]
|
maven: [ '3.8.8', '3.9.6' ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
test-deault:
|
test-default:
|
||||||
name: Test with defaults
|
name: Test with defaults
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
@ -45,20 +45,41 @@ jobs:
|
|||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
|
||||||
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.4
|
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.6
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
# regressions tests
|
||||||
|
test-issue-68:
|
||||||
|
name: Test for issue 68
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
settings-servers: |
|
||||||
|
[{
|
||||||
|
"id": "ossrh",
|
||||||
|
"username": "${{ vars.TEST_68_1 }}",
|
||||||
|
"password": "${{ vars.TEST_68_2 }}"
|
||||||
|
}]
|
||||||
|
|
||||||
|
- run: cat ~/.m2/settings.xml
|
||||||
|
- run: |
|
||||||
|
grep "<id>ossrh</id>" ~/.m2/settings.xml
|
||||||
|
grep "<username>username-68</username>" ~/.m2/settings.xml
|
||||||
|
grep "<password>password-68</password>" ~/.m2/settings.xml
|
||||||
|
|
||||||
test-ok:
|
test-ok:
|
||||||
name: Test OK
|
name: Test OK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ test, test-deault ]
|
needs: [ test, test-default, test-issue-68 ]
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo "needs.test.result=${{ needs.test.result }} needs.test-deault.result=${{ needs.test-deault.result }}"
|
|
||||||
|
|
||||||
- run: 'true'
|
- run: 'true'
|
||||||
if: needs.test.result == 'success' && needs.test-deault.result == 'success'
|
if: join(needs.*.result, ',') == 'success,success,success'
|
||||||
|
|
||||||
- run: 'false'
|
- run: 'false'
|
||||||
if: needs.test.result != 'success' || needs.test-deault.result != 'success'
|
if: join(needs.*.result, ',') != 'success,success,success'
|
||||||
|
|||||||
@ -60,6 +60,7 @@ So we can use for action:
|
|||||||
|
|
||||||
| params | description |
|
| params | description |
|
||||||
|----------------|----------------------------------------------------------|
|
|----------------|----------------------------------------------------------|
|
||||||
|
| cache-enabled | enable cache. Default true |
|
||||||
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
| cache-path | default cache path for Maven with value ~/.m2/repository |
|
||||||
| cache-path-add | additional value for cache path |
|
| cache-path-add | additional value for cache path |
|
||||||
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
| cache-prefix | prefix value for `key` and `restore-keys` cache params |
|
||||||
@ -69,7 +70,7 @@ So we can use for action:
|
|||||||
|
|
||||||
| params | destination | default |
|
| params | destination | default |
|
||||||
|---------------|---------------|---------|
|
|---------------|---------------|---------|
|
||||||
| maven-version | maven-version | 3.9.4 |
|
| maven-version | maven-version | 3.9.6 |
|
||||||
|
|
||||||
## maven-settings-action
|
## maven-settings-action
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
maven: [ '3.8.8', '3.9.4' ]
|
maven: [ '3.8.8', '3.9.6' ]
|
||||||
|
|
||||||
name: Maven ${{ matrix.maven }} sample
|
name: Maven ${{ matrix.maven }} sample
|
||||||
|
|
||||||
|
|||||||
16
action.yml
16
action.yml
@ -48,6 +48,11 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
# cache
|
# cache
|
||||||
|
cache-enabled:
|
||||||
|
description: 'Enable cache'
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
|
|
||||||
cache-prefix:
|
cache-prefix:
|
||||||
description: 'Cache key prefix'
|
description: 'Cache key prefix'
|
||||||
required: false
|
required: false
|
||||||
@ -64,7 +69,7 @@ inputs:
|
|||||||
# maven version
|
# maven version
|
||||||
maven-version:
|
maven-version:
|
||||||
description: 'The Maven version to set up'
|
description: 'The Maven version to set up'
|
||||||
default: '3.9.4'
|
default: '3.9.6'
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
# maven settings.xml
|
# maven settings.xml
|
||||||
@ -98,13 +103,14 @@ runs:
|
|||||||
repository: '${{ inputs.checkout-repository }}'
|
repository: '${{ inputs.checkout-repository }}'
|
||||||
token: '${{ inputs.checkout-token }}'
|
token: '${{ inputs.checkout-token }}'
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
overwrite-settings: false
|
overwrite-settings: false
|
||||||
java-version: '${{ inputs.java-version }}'
|
java-version: '${{ inputs.java-version }}'
|
||||||
distribution: '${{ inputs.java-distribution }}'
|
distribution: '${{ inputs.java-distribution }}'
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v4
|
||||||
|
if: inputs.cache-enabled == 'true'
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ inputs.cache-path }}
|
${{ inputs.cache-path }}
|
||||||
@ -117,12 +123,12 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
id: current-maven
|
id: current-maven
|
||||||
|
|
||||||
- uses: stCarolas/setup-maven@v4.5
|
- uses: stCarolas/setup-maven@v5
|
||||||
if: inputs.maven-version != steps.current-maven.outputs.version
|
if: inputs.maven-version != steps.current-maven.outputs.version
|
||||||
with:
|
with:
|
||||||
maven-version: '${{ inputs.maven-version }}'
|
maven-version: '${{ inputs.maven-version }}'
|
||||||
|
|
||||||
- uses: s4u/maven-settings-action@v2.8.0
|
- uses: s4u/maven-settings-action@v3.0.0
|
||||||
with:
|
with:
|
||||||
servers: '${{ inputs.settings-servers}}'
|
servers: '${{ inputs.settings-servers}}'
|
||||||
mirrors: '${{ inputs.settings-mirrors}}'
|
mirrors: '${{ inputs.settings-mirrors}}'
|
||||||
|
|||||||
Reference in New Issue
Block a user