Skip to content

Commit 6a0d6ac

Browse files
committed
feat(ci): add self-test workflow for action verification
Introduce a workflow to validate the action functionality across multiple operating systems. This ensures that the local action correctly installs the specified version of safe-clean and that the resulting binary is executable and functional.
1 parent 267476e commit 6a0d6ac

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test Safe Clean Action
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "safe-clean version to install, e.g. latest or v0.1.0"
8+
required: false
9+
default: "latest"
10+
11+
release:
12+
types:
13+
- published
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
test-action:
20+
name: Test action on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
35+
- name: Resolve version
36+
id: version
37+
shell: bash
38+
run: |
39+
if [ "${{ github.event_name }}" = "release" ]; then
40+
echo "version=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
41+
else
42+
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
43+
fi
44+
45+
- name: Install safe-clean via local action
46+
uses: ./
47+
with:
48+
version: ${{ steps.version.outputs.version }}
49+
50+
- name: Check binary
51+
shell: bash
52+
run: |
53+
which safe-clean
54+
safe-clean --help

0 commit comments

Comments
 (0)