cargo-semver-checks/.github/workflows/ci.yml
2023-01-03 09:45:54 -05:00

45 lines
1.3 KiB
YAML

name: CI
on:
pull_request:
push:
branches:
- main
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
jobs:
test-action:
name: Test the action
runs-on: ubuntu-latest
steps:
- name: Checkout the test repository
uses: actions/checkout@v3
with:
repository: mgr0dzicki/cargo-semver-action-ref-slice
fetch-depth: 0
persist-credentials: true
- name: Checkout the action
uses: actions/checkout@v3
with:
path: action
- name: Checkout the test with patch change and patch version bump
run: git checkout patch_change
- name: Run the action
uses: ./action/
- name: Checkout the test with major change and patch version bump
run: git checkout major_change
- name: Run the action (allowed to fail)
id: action_major
uses: ./action/
continue-on-error: true
- name: Check the action outcome
run: |
if [[ "${{ steps.action_major.outcome }}" != 'failure' ]]; then
echo "Error! The action should have failed because of the breaking change, but it has not."
exit 1
else
echo "OK! The action has failed as expected on the breaking change."
fi