Skip to content

Changed version for testing. #34

Changed version for testing.

Changed version for testing. #34

name: Test current branch
on:
push:
secrets:
USER:
required: true
DEPLOY_GITHUB_TOKEN:
required: true
workflow_call:
secrets:
USER:
required: true
DEPLOY_GITHUB_TOKEN:
required: true
workflow_dispatch:
secrets:
USER:
required: true
DEPLOY_GITHUB_TOKEN:
required: true
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/*pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run action (non-branch version)
id: run-action-non-branch-version
uses: maven-flow/manage-versions@main
env:
USER: ${{ secrets.USER }}
TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
with:
enforce-branch-version: true
maven-args: "-P github -s ${GITHUB_WORKSPACE}/.github/workflows/maven-settings.xml"
pom-file: "non-branch-version-pom.xml"
- name: Assert version unchanged
run: .github/workflows/assert-project-version.sh non-branch-version-pom.xml 1.1.0-SNAPSHOT
- name: Assert dependency version unchanged
run: .github/workflows/assert-dependency-version.sh non-branch-version-pom.xml com.jardoapps.maven-flow dummy-dependency 1.1.0-SNAPSHOT
- name: Run action (branch version)
id: run-action-branch-version
uses: maven-flow/manage-versions@main
env:
USER: ${{ secrets.USER }}
TOKEN: ${{ secrets.DEPLOY_GITHUB_TOKEN }}
with:
enforce-branch-version: true
maven-args: "-P github -s ${GITHUB_WORKSPACE}/.github/workflows/maven-settings.xml"
pom-file: "branch-version-pom.xml"
- name: Assert version changed
run: .github/workflows/assert-project-version.sh branch-version-pom.xml 1.1.0-SNAPSHOT
- name: Assert dependency version changed
run: .github/workflows/assert-dependency-version.sh branch-version-pom.xml com.jardoapps.maven-flow dummy-dependency 1.1.0-SNAPSHOT