Use actions/checkout

This commit is contained in:
Slawomir Jaranowski
2021-08-30 08:23:28 +02:00
parent 6f35cfffb0
commit 638a374dff
2 changed files with 25 additions and 2 deletions

View File

@ -3,17 +3,20 @@
This is composite action which help to prepare GitHub Actions environment for Maven build by calling: 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/setup-java](https://github.com/marketplace/actions/setup-java-jdk)
- [actions/cache](https://github.com/marketplace/actions/cache) - [actions/cache](https://github.com/marketplace/actions/cache)
- [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven) - [stCarolas/setup-maven](https://github.com/marketplace/actions/setup-maven)
- [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action) - [s4u/maven-settings-action](https://github.com/marketplace/actions/maven-settings-action)
# Contributions # Contributions
- Contributions are welcome! - Contributions are welcome!
- Give :star: - if you want to encourage me to work on a project - 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 - Don't hesitate to create issues for new features you dream of or if you suspect some bug
# Project versioning # Project versioning
This project uses [Semantic Versioning](https://semver.org/). This project uses [Semantic Versioning](https://semver.org/).
We recommended to use the latest and specific release version. 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 # Params mapping for sub actions
## checkout
| params | destination |
| -------------------------- |------------------ |
| checkout-fetch-depth | fetch-depth |
## setup-java ## setup-java
| params | destination | default | | params | destination | default |
@ -82,13 +92,13 @@ jobs:
name: Maven ${{ matrix.maven }} sample name: Maven ${{ matrix.maven }} sample
steps: steps:
- uses: actions/checkout@v2
- name: Setup Maven with settings.xml - name: Setup Maven with settings.xml
uses: s4u/setup-maven-action@v1.0.0 uses: s4u/setup-maven-action@< version >
with: with:
java-version: 8 java-version: 8
maven-version: ${{ matrix.maven }} maven-version: ${{ matrix.maven }}
- run: mvn -V ... - run: mvn -V ...
``` ```

View File

@ -7,6 +7,11 @@ branding:
inputs: inputs:
# checkout
checkout-fetch-depth:
description: 'Number of commits to fetch'
required: false
# java jdk params # java jdk params
java-version: java-version:
@ -60,6 +65,14 @@ runs:
steps: steps:
- run: echo "::group::Checkout"
shell: bash
- uses: actions/checkout@v2.3.4
with:
fetch-depth: '${{ inputs.checkout-fetch-depth }}'
- run: echo "::endgroup::"
shell: bash
- run: echo "::group::Setup Java" - run: echo "::group::Setup Java"
shell: bash shell: bash
- uses: actions/setup-java@v2.3.0 - uses: actions/setup-java@v2.3.0