mirror of
https://github.com/s4u/setup-maven-action.git
synced 2026-02-14 00:03:08 +08:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d27f7bad34 | |||
| 07db3fb4b2 | |||
| 3a36aae9ec | |||
| b8af8b0ed8 | |||
| 336767f6a6 | |||
| 078175723e | |||
| 38506fd243 | |||
| 41d4657217 | |||
| e9a7bdc6d6 | |||
| b3d576e79a | |||
| ff43cac4ad | |||
| cac57cc0b0 | |||
| 490f541598 | |||
| 638a374dff |
26
.github/workflows/test.yml
vendored
26
.github/workflows/test.yml
vendored
@ -12,7 +12,7 @@ on:
|
||||
- cron: '22 23 * * 5'
|
||||
|
||||
concurrency:
|
||||
group: test-action
|
||||
group: test-action-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@ -22,8 +22,8 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
|
||||
java: [ '8', '11', '16' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.2' ]
|
||||
java: [ '8', '11', '17' ]
|
||||
maven: [ '3.5.4', '3.6.3', '3.8.3' ]
|
||||
fail-fast: false
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -40,3 +40,23 @@ jobs:
|
||||
- run: mvn -V validate -Drequire.java=${{ matrix.java }} -Drequire.maven=${{ matrix.maven }}
|
||||
shell: bash
|
||||
|
||||
test-deault:
|
||||
name: Test with defaults
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.4
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
java-version: 8
|
||||
|
||||
- run: mvn -V validate -Drequire.java=8 -Drequire.maven=3.8.3
|
||||
shell: bash
|
||||
|
||||
test-ok:
|
||||
name: Test OK
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test, test-deault ]
|
||||
steps:
|
||||
- run: echo OK
|
||||
|
||||
20
README.md
20
README.md
@ -1,19 +1,22 @@
|
||||
# Setup Maven with settings.xml
|
||||
# Setup Maven Action
|
||||
[](https://github.com/s4u/setup-maven-action/actions/workflows/test.yml)
|
||||
|
||||
This is composite action which help to prepare GitHub Actions environment for Maven build by calling:
|
||||
|
||||
- [actions/checkout](https://github.com/marketplace/actions/checkout)
|
||||
- [actions/setup-java](https://github.com/marketplace/actions/setup-java-jdk)
|
||||
- [actions/cache](https://github.com/marketplace/actions/cache)
|
||||
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
|
||||
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
|
||||
|
||||
# Contributions
|
||||
|
||||
- Contributions are welcome!
|
||||
- Give :star: - if you want to encourage me to work on a project
|
||||
- Don't hesitate to create issues for new features you dream of or if you suspect some bug
|
||||
|
||||
# Project versioning
|
||||
|
||||
This project uses [Semantic Versioning](https://semver.org/).
|
||||
We recommended to use the latest and specific release version.
|
||||
|
||||
@ -22,6 +25,13 @@ or use automatic tools like [Dependabot](https://docs.github.com/en/code-securit
|
||||
|
||||
# Params mapping for sub actions
|
||||
|
||||
## checkout
|
||||
|
||||
| params | destination |
|
||||
| -------------------------- |------------------ |
|
||||
| checkout-fetch-depth | fetch-depth |
|
||||
|
||||
|
||||
## setup-java
|
||||
|
||||
| params | destination | default |
|
||||
@ -56,7 +66,7 @@ So we can use for action:
|
||||
|
||||
| params | destination | default |
|
||||
| ------------- |-------------- |-------- |
|
||||
| maven-version | maven-version | 3.8.1 |
|
||||
| maven-version | maven-version | 3.8.3 |
|
||||
|
||||
## maven-settings-action
|
||||
|
||||
@ -82,13 +92,13 @@ jobs:
|
||||
name: Maven ${{ matrix.maven }} sample
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Maven with settings.xml
|
||||
uses: s4u/setup-maven-action@v1.0.0
|
||||
- name: Setup Maven Action
|
||||
uses: s4u/setup-maven-action@< version >
|
||||
with:
|
||||
java-version: 8
|
||||
maven-version: ${{ matrix.maven }}
|
||||
|
||||
- run: mvn -V ...
|
||||
```
|
||||
|
||||
|
||||
35
action.yml
35
action.yml
@ -1,5 +1,5 @@
|
||||
name: 'Setup Maven with settings.xml'
|
||||
description: 'Setup environment for Maven build'
|
||||
name: 'Setup Maven Action'
|
||||
description: 'Complete environment configuration for Maven builds'
|
||||
|
||||
branding:
|
||||
icon: 'settings'
|
||||
@ -7,6 +7,11 @@ branding:
|
||||
|
||||
inputs:
|
||||
|
||||
# checkout
|
||||
checkout-fetch-depth:
|
||||
description: 'Number of commits to fetch'
|
||||
required: false
|
||||
|
||||
# java jdk params
|
||||
|
||||
java-version:
|
||||
@ -35,7 +40,7 @@ inputs:
|
||||
# maven version
|
||||
maven-version:
|
||||
description: 'The Maven version to set up'
|
||||
default: '3.8.1'
|
||||
default: '3.8.3'
|
||||
required: false
|
||||
|
||||
# maven settings.xml
|
||||
@ -60,18 +65,16 @@ runs:
|
||||
|
||||
steps:
|
||||
|
||||
- run: echo "::group::Setup Java"
|
||||
shell: bash
|
||||
- uses: actions/setup-java@v2.3.0
|
||||
- uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
|
||||
|
||||
- uses: actions/setup-java@v2.3.1
|
||||
with:
|
||||
overwrite-settings: false
|
||||
java-version: '${{ inputs.java-version }}'
|
||||
distribution: '${{ inputs.java-distribution }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Setup Cache"
|
||||
shell: bash
|
||||
- uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: |
|
||||
@ -79,24 +82,14 @@ runs:
|
||||
${{ inputs.cache-path-add }}
|
||||
key: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ inputs.cache-prefix }}${{ runner.os }}-jdk${{ inputs.java-version }}-${{ inputs.java-distribution }}-maven${{ inputs.maven-version }}-
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Setup Maven Version"
|
||||
shell: bash
|
||||
- uses: stCarolas/setup-maven@v4.1
|
||||
- uses: stCarolas/setup-maven@v4.2
|
||||
with:
|
||||
maven-version: '${{ inputs.maven-version }}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
- run: echo "::group::Prepare Maven settings.xml"
|
||||
shell: bash
|
||||
- uses: s4u/maven-settings-action@v2.4.1
|
||||
with:
|
||||
servers: '${{ inputs.settings-servers}}'
|
||||
mirrors: '${{ inputs.settings-mirrors}}'
|
||||
properties: '${{ inputs.settings-properties}}'
|
||||
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'
|
||||
- run: echo "::endgroup::"
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user