Release 0.4.0 #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: verify | |
on: [ pull_request ] | |
jobs: | |
release-ready: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'stable' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get current version | |
id: current_version | |
run: | | |
version="$(gradle -q version)" | |
echo "$version" | |
echo "::set-output name=current_version::$version" | |
shell: bash | |
- name: Check version format | |
run: | | |
# verify the version has "MAJOR.MINOR.PATCH" parts only | |
echo "${{ steps.current_version.outputs.current_version }}" | grep -e '^[0-9]\+\.[0-9]\+\.[0-9]\+$' | |
shell: bash | |
# TODO improve (DRY): copy-paste from release.yml | |
- name: Get release info | |
id: release_info | |
run: | | |
release_info="$(curl -s https://api.github.com/repos/${{ github.repository }}/releases \ | |
| jq '.[] | select(.name == "v${{ steps.current_version.outputs.current_version }}")')" | |
echo "::set-output name=release_info::$release_info" | |
echo "$release_info" | |
shell: bash | |
- name: Check version bumped | |
# TODO check if greater than latest tag / release (?) | |
if: steps.release_info.outputs.release_info | |
run: exit 1 | |
# XXX do we need that here | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 8 | |
- name: check it can be packaged | |
run: | | |
gradle jar | |
ls lib/build/libs | |
shell: bash | |
unit: | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
java: ['8', '11', '13', '15', '17' ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ matrix.java }} | |
- name: Execute tests | |
run: gradle test | |
static-ktlint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'zulu' | |
java-version: 8 | |
- name: check code | |
run: gradle ktlintCheck |