4 Commits

Author SHA1 Message Date
1c4f3ff3dc Issue 68 2024-02-11 13:59:09 +01:00
e435effde6 Issue 68 2024-02-11 13:55:26 +01:00
e97b30e967 Issue 68 2024-02-11 13:52:02 +01:00
ae19451abc Issue 68 2024-02-11 13:46:04 +01:00
3 changed files with 55 additions and 82 deletions

View File

@ -19,13 +19,13 @@ jobs:
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macOS-latest' ]
java: [ '8', '11', '17', '21' ]
maven: [ '3.8.8', '3.9.9' ]
maven: [ '3.8.8', '3.9.6' ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@v4
- uses: ./
with:
@ -41,22 +41,45 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@v4
- uses: ./
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.9
- run: mvn -V validate -Drequire.java=17 -Drequire.maven=3.9.6
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:
name: Test OK
runs-on: ubuntu-latest
needs: [ test, test-default ]
needs: [ test, test-default, test-issue-68 ]
if: always()
steps:
- run: 'true'
if: join(needs.*.result, ',') == 'success,success'
if: join(needs.*.result, ',') == 'success,success,success'
- run: 'false'
if: join(needs.*.result, ',') != 'success,success'
if: join(needs.*.result, ',') != 'success,success,success'

View File

@ -21,21 +21,18 @@ For default values you only need:
- run: mvn -V ...
```
# Params mapping for sub actions
## checkout
| params | destination | default |
|------------------------------|---------------------|--------------------------|
| checkout-enabled | enabled | true |
| checkout-fetch-depth | fetch-depth | |
| checkout-submodules | submodules | |
| checkout-path | path | |
| checkout-ref | ref | |
| checkout-repository | repository | ${{ github.repository }} |
| checkout-token | token | ${{ github.token }} |
| checkout-ssh-key | ssh-key | |
| checkout-persist-credentials | persist-credentials | false |
## setup-java
@ -43,7 +40,7 @@ For default values you only need:
| params | destination | default |
|-------------------|--------------|---------|
| java-version | java-version | 17 |
| java-distribution | distribution | zulu |
| java-distribution | distribution | temurin |
## cache
@ -64,7 +61,7 @@ So we can use for action:
| 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-prefix | prefix value for `key` and `restore-keys` cache params |
@ -73,21 +70,16 @@ So we can use for action:
| params | destination | default |
|---------------|---------------|---------|
| maven-version | maven-version | 3.9.9 |
| maven-version | maven-version | 3.9.6 |
## maven-settings-action
| params | destination |
|-----------------------------|--------------------|
| settings-servers | servers |
| settings-mirrors | mirrors |
| settings-properties | properties |
| settings-sonatypeSnapshots | sonatypeSnapshots |
| settings-proxies | proxies |
| settings-repositories | repositories |
| settings-pluginRepositories | pluginRepositories |
| settings-githubServer | githubServer |
| settings-path | path |
| params | destination |
|----------------------------|-------------------|
| settings-servers | servers |
| settings-mirrors | mirrors |
| settings-properties | properties |
| settings-sonatypeSnapshots | sonatypeSnapshots |
# Testing against different Maven versions
@ -99,7 +91,7 @@ jobs:
strategy:
matrix:
maven: [ '3.8.8', '3.9.8' ]
maven: [ '3.8.8', '3.9.6' ]
name: Maven ${{ matrix.maven }} sample

View File

@ -8,19 +8,10 @@ branding:
inputs:
# checkout
checkout-enabled:
description: 'Enable checkout'
default: 'true'
required: false
checkout-fetch-depth:
description: 'Number of commits to fetch'
required: false
checkout-submodules:
description: 'Whether to fetch submodules'
required: false
checkout-path:
description: 'Relative path under $GITHUB_WORKSPACE to place the repository'
required: false
@ -44,10 +35,6 @@ inputs:
required: false
default: ${{ github.token }}
checkout-ssh-key:
description: 'SSH key used to fetch the repository. It allows to run authenticated git commands'
required: false
# java jdk params
java-version:
@ -57,7 +44,7 @@ inputs:
java-distribution:
description: 'Java distribution'
default: 'zulu'
default: 'temurin'
required: false
# cache
@ -82,71 +69,47 @@ inputs:
# maven version
maven-version:
description: 'The Maven version to set up'
default: '3.9.9'
default: '3.9.6'
required: false
# maven settings.xml
settings-servers:
description: 'servers definition in json array, e.g.: [{"id": "serverId", "username": "username", "password": "password"}]'
description: 'servers definition in json array, eg: [{"id": "serverId", "username": "username", "password": "password"}]'
required: false
settings-mirrors:
description: 'mirrors definition in json array, e.g.: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
description: 'mirrors definition in json array, eg: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
required: false
settings-properties:
description: 'json array with properties, e.g.: [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
description: 'json array with properties, eg [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
required: false
settings-sonatypeSnapshots:
description: 'add https://oss.sonatype.org/content/repositories/snapshots to repository list - true or false'
required: false
settings-proxies:
description: 'proxies definition in json array, e.g.: [{"id": "http-proxy", "active": "true", "protocol": "http", "host": "host", "port": "port", "nonProxyHosts": "host1|host2"}]'
required: false
settings-repositories:
description: 'repository settings definition in json array, e.g.: [ { "id": "repoId","name": "repoName","url": "url","snapshots": { "enabled": true } } ]'
required: false
settings-pluginRepositories:
description: 'plugin repository settings definition in json array, e.g.: [{"id":"repoId","name":"repoName","url":"url","snapshots":{"enabled":true}}]'
required: false
settings-githubServer:
description: 'add to settings.xml servers server-id: github; username=$GITHUB_ACTOR and password=$GITHUB_TOKEN'
default: "true"
required: false
settings-path:
description: 'override default path to settings.xml which is $HOME/.m2/settings.xml'
required: false
runs:
using: 'composite'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: inputs.checkout-enabled == 'true'
- uses: actions/checkout@v4
with:
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
submodules: '${{ inputs.checkout-submodules }}'
path: '${{ inputs.checkout-path }}'
persist-credentials: '${{ inputs.checkout-persist-credentials }}'
ref: '${{ inputs.checkout-ref }}'
repository: '${{ inputs.checkout-repository }}'
token: '${{ inputs.checkout-token }}'
ssh-key: '${{ inputs.checkout-ssh-key }}'
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
- uses: actions/setup-java@v4
with:
overwrite-settings: false
java-version: '${{ inputs.java-version }}'
distribution: '${{ inputs.java-distribution }}'
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
- uses: actions/cache@v4
if: inputs.cache-enabled == 'true'
with:
path: |
@ -160,19 +123,14 @@ runs:
shell: bash
id: current-maven
- uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 # v5
- uses: stCarolas/setup-maven@v5
if: inputs.maven-version != steps.current-maven.outputs.version
with:
maven-version: '${{ inputs.maven-version }}'
- uses: s4u/maven-settings-action@64e42c454dbd42ef6370ac8539685755aedd205b # v3.1.0
- uses: s4u/maven-settings-action@v3.0.0
with:
servers: '${{ inputs.settings-servers }}'
mirrors: '${{ inputs.settings-mirrors }}'
properties: '${{ inputs.settings-properties }}'
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots }}'
proxies: '${{ inputs.settings-proxies }}'
repositories: '${{ inputs.settings-repositories }}'
pluginRepositories: '${{ inputs.settings-pluginRepositories }}'
githubServer: '${{ inputs.settings-githubServer }}'
path: '${{ inputs.settings-path }}'
servers: '${{ inputs.settings-servers}}'
mirrors: '${{ inputs.settings-mirrors}}'
properties: '${{ inputs.settings-properties}}'
sonatypeSnapshots: '${{ inputs.settings-sonatypeSnapshots}}'