2023-02-25 14:16:59 +01:00
|
|
|
name: Smoke test the action
|
|
|
|
|
|
|
|
# Assumes that the latest published normal version of `ref_slice` smaller
|
|
|
|
# than 1.2.2 is 1.2.1.
|
|
|
|
# TODO: Change the crate version in the corresponding branches `patch_change`
|
|
|
|
# and `major_change` to 1.2.1 once new logic of choosing baseline is adapted.
|
|
|
|
# Otherwise if new version 1.2.2 of `ref_slice` is released, the tests might
|
|
|
|
# stop working correctly.
|
2023-01-09 00:46:08 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
runs-on:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-tests:
|
|
|
|
name: Run tests
|
|
|
|
runs-on: ${{ inputs.runs-on }}
|
|
|
|
steps:
|
2023-02-27 20:35:32 +01:00
|
|
|
- name: Checkout the test repository and test with patch change and patch version bump
|
2023-01-09 00:46:08 +01:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: mgr0dzicki/cargo-semver-action-ref-slice
|
2023-02-27 20:35:32 +01:00
|
|
|
ref: patch_change
|
2023-01-09 00:46:08 +01:00
|
|
|
persist-credentials: true
|
|
|
|
- name: Checkout the action
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
- name: Run the action
|
|
|
|
uses: ./action/
|
|
|
|
- name: Checkout the test with major change and patch version bump
|
2023-02-27 20:35:32 +01:00
|
|
|
run: |
|
|
|
|
git fetch origin major_change
|
|
|
|
git checkout major_change
|
2023-01-09 00:46:08 +01:00
|
|
|
- name: Run the action (allowed to fail)
|
|
|
|
id: action_major
|
|
|
|
uses: ./action/
|
|
|
|
continue-on-error: true
|
|
|
|
- name: Fail if the action has not returned any errors (but it should have)
|
|
|
|
if: steps.action_major.outcome != 'failure'
|
|
|
|
run: |
|
|
|
|
echo "Error! The action should have failed because of the breaking change, but it has not."
|
|
|
|
exit 1
|