gh-action-bump-version/tests/end-to-end/config.yaml

187 lines
4.5 KiB
YAML

suites:
- name: default
yaml:
name: Bump Version
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tests:
- message: no keywords
expected:
version: 1.0.1
- message: feat
expected:
version: 1.1.0
- message: minor
expected:
version: 1.2.0
- message: BREAKING CHANGE
expected:
version: 2.0.0
- message: major
expected:
version: 3.0.0
- message: pre-alpha
expected:
version: 3.0.1-alpha.0
- message: pre-beta
expected:
version: 3.0.1-beta.0
- message: pre-rc
expected:
version: 3.0.1-rc.0
- name: no-push
yaml:
name: Do Nothing
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
push: false
tests:
- message: no keywords
expected:
version: 3.0.1-rc.0
- name: custom-wording
yaml:
name: Bump Version (Custom Wording)
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
minor-wording: custom-minor
major-wording: custom-major
rc-wording: custom-pre
tests:
- message: custom-minor
expected:
version: 3.1.0
- message: custom-major
expected:
version: 4.0.0
- message: custom-pre
expected:
version: 4.0.1-pre.0
- name: null-default
yaml:
name: Bump Version (Default="Minor")
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default: null
patch-wording: patch
tests:
- message: no hint
expected:
version: 4.0.1-pre.0
- message: patch
expected:
version: 4.1.1
- name: custom-tag-prefix
yaml:
name: Bump Version (Custom Tag Prefix)
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag-prefix: 'v'
tests:
- message: no keywords
expected:
version: 4.1.2
tag: v4.1.2
- name: target-branch
yaml:
name: Bump Version (Target Branch)
on:
push:
branches:
- main
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: git branch other-branch
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target-branch: other-branch
tests:
- message: no keywords
expected:
version: 4.1.3
branch: other-branch
- name: skip-commit
yaml:
name: Bump Version (Skip Commit)
on:
push:
jobs:
bump-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: version-bump
uses: ./action
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skip-commit: true
tests:
- message: no keywords
expected:
version: 4.1.4
message: 'ci: version bump to 4.1.3'
actionFiles:
- index.js
- Dockerfile
- package.json
- package-lock.json
- action.yml
image: catthehacker/ubuntu:act-latest