-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (85 loc) · 2.52 KB
/
Copy pathpull-request.yml
File metadata and controls
97 lines (85 loc) · 2.52 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 𝌡 Pull Request
on:
pull_request:
branches: [master]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: 🚚 Checkout project
uses: actions/checkout@v6
- name: Test Single Line
id: test1
uses: ./
with:
ref: refs/tags/@johngw/my-package-v1.2.3
regex: refs/tags/(?P<package>@johngw/[a-zA-Z0-9_-]+)-v(?P<version>\d+.\d+.\d+)$
- name: 🧪 Assert Package
run: |
PACKAGE='${{ fromJSON(steps.test1.outputs.groups).package }}'
if [[ $PACKAGE != '@johngw/my-package' ]]
then
echo "$PACKAGE does not equal '@johngw/my-package'"
exit 1
fi
- name: 🧪 Assert Version
run: |
VERSION='${{ fromJSON(steps.test1.outputs.groups).version }}'
if [[ $VERSION != '1.2.3' ]]
then
echo "$VERSION does not equal '1.2.3'"
exit 1
fi
- name: Test Multiline
id: test2
uses: ./
with:
ref: |
h
e
l
l
o
regex: '[\n\r]*(?P<letter>h)'
- name: 🧪 Assert Multiline
run: |
LETTER='${{ fromJSON(steps.test2.outputs.groups).letter }}'
if [[ $LETTER != 'h' ]]
then
echo "$LETTER does not equal 'h'"
exit 1
fi
test-without-python:
name: Test (no Python preinstalled)
runs-on: ubuntu-latest
container:
image: ubuntu:latest
steps:
- name: 📦 Install git
run: |
apt-get update
apt-get install -y --no-install-recommends git ca-certificates
- name: 🧪 Assert Python is not preinstalled
run: |
if command -v python3 >/dev/null 2>&1 || command -v python >/dev/null 2>&1
then
echo "Python is preinstalled; this test requires an image without it"
exit 1
fi
- name: 🚚 Checkout project
uses: actions/checkout@v6
- name: Test Single Line
id: test
uses: ./
with:
ref: refs/tags/@johngw/my-package-v1.2.3
regex: refs/tags/(?P<package>@johngw/[a-zA-Z0-9_-]+)-v(?P<version>\d+.\d+.\d+)$
- name: 🧪 Assert Package
run: |
PACKAGE='${{ fromJSON(steps.test.outputs.groups).package }}'
if [[ $PACKAGE != '@johngw/my-package' ]]
then
echo "$PACKAGE does not equal '@johngw/my-package'"
exit 1
fi