2023-02-25 14:16:59 +01:00
|
|
|
name: Smoke test the action
|
|
|
|
|
2023-04-08 16:19:56 +02:00
|
|
|
# Assumes that the latest published normal version of `ref_slice` not greater
|
|
|
|
# than 1.2.1 is 1.2.1 itself.
|
2023-01-09 00:46:08 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: 1
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-tests:
|
|
|
|
name: Run tests
|
2023-04-17 14:45:37 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-07-14 21:23:01 +02:00
|
|
|
os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
2024-10-18 20:17:55 +02:00
|
|
|
toolchain: ['1.80', 'stable', 'beta']
|
2024-07-14 21:23:01 +02:00
|
|
|
experimental: [false]
|
|
|
|
include:
|
|
|
|
- os: 'ubuntu-latest'
|
|
|
|
toolchain: 'nightly'
|
|
|
|
experimental: true
|
|
|
|
- os: 'windows-latest'
|
|
|
|
toolchain: 'nightly'
|
|
|
|
experimental: true
|
|
|
|
- os: 'macos-latest'
|
|
|
|
toolchain: 'nightly'
|
|
|
|
experimental: true
|
|
|
|
continue-on-error: ${{ matrix.experimental }}
|
2023-04-17 14:45:37 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-01-09 00:46:08 +01:00
|
|
|
steps:
|
2023-02-27 20:35:32 +01:00
|
|
|
- name: Checkout the test repository and test with patch change and patch version bump
|
2024-03-19 19:30:33 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-01-09 00:46:08 +01:00
|
|
|
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
|
2024-03-19 19:30:33 +01:00
|
|
|
uses: actions/checkout@v4
|
2023-01-09 00:46:08 +01:00
|
|
|
with:
|
|
|
|
path: action
|
|
|
|
- name: Run the action
|
|
|
|
uses: ./action/
|
2023-04-17 14:45:37 +02:00
|
|
|
with:
|
|
|
|
rust-toolchain: ${{ matrix.toolchain }}
|
2023-01-09 00:46:08 +01:00
|
|
|
- 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-04-23 20:24:06 +02:00
|
|
|
- name: Run the action (expected to fail)
|
2023-01-09 00:46:08 +01:00
|
|
|
id: action_major
|
|
|
|
uses: ./action/
|
2023-04-17 14:45:37 +02:00
|
|
|
with:
|
|
|
|
rust-toolchain: ${{ matrix.toolchain }}
|
2023-01-09 00:46:08 +01:00
|
|
|
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
|