-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (55 loc) · 1.67 KB
/
Copy pathtest.yml
File metadata and controls
64 lines (55 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Tests for the action itself. Nothing here releases anything.
name: Test
on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# The action runs whatever python3 the runner image ships, so test the
# range that has plausibly been one of them.
python: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Run the unit tests
run: python3 -m unittest discover -s tests -v
# Exercise the action end to end without publishing: a dry run against this
# repository's own fixture manifest. This is what catches action.yml wiring
# mistakes (a misspelled input, a step output that never gets set), which the
# unit tests cannot see.
dry-run:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Dry run against the fixture manifest
id: release
uses: ./
with:
plugin-json: tests/fixtures/plugin.json
dry-run: true
checkout: false
- name: Check the outputs
env:
VERSION: ${{ steps.release.outputs.version }}
PREVIOUS: ${{ steps.release.outputs.previous }}
TAG: ${{ steps.release.outputs.tag }}
run: |
set -euo pipefail
test "$PREVIOUS" = "1.3.5"
test "$VERSION" = "1.3.6"
test "$TAG" = "1.3.6"
echo "Dry run reported $PREVIOUS -> $VERSION"