-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (128 loc) · 4.67 KB
/
tests.version-autopilot.yml
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: tests.version-autopilot
on:
workflow_call:
jobs:
tests:
runs-on: 'ubuntu-latest'
steps:
- name: checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- name: va_0_0_0 start at zero test
id: va_0_0_0
env:
PATCH_OVERRIDE: 0
uses: ./dist/apps/version-autopilot
with:
major: 0
minor: 0
- name: assert_va_0_0_0
run: |
set -ex
version_autopilot_string_recommended=${{ steps.va_0_0_0.outputs.version_autopilot_string_recommended }}
version_autopilot_string=${{ steps.va_0_0_0.outputs.version_autopilot_string }}
version_autopilot_code=${{ steps.va_0_0_0.outputs.version_autopilot_code }}
if [[ "${version_autopilot_code}" != '0' ]]; then
echo "${version_autopilot_code} is not 0"
exit 1
fi
if [[ "${version_autopilot_string}" != "0.0.0" ]]; then
echo "${version_autopilot_string} is not 0.0.0"
exit 1
fi
- name: va_0_0_50 shift test
id: va_0_0_50
uses: ./dist/apps/version-autopilot
env:
PATCH_OVERRIDE: 0
with:
major: 0
minor: 0
shift: 50
- name: assert_va_0_0_50 shift test
run: |
set -ex
version_autopilot_string_recommended=${{ steps.va_0_0_50.outputs.version_autopilot_string_recommended }}
version_autopilot_string=${{ steps.va_0_0_50.outputs.version_autopilot_string }}
version_autopilot_code=${{ steps.va_0_0_50.outputs.version_autopilot_code }}
if [[ "${version_autopilot_code}" != "50" ]]; then
echo "${version_autopilot_code} is not 50"
exit 1
fi
if [[ "${version_autopilot_string}" != "0.0.50" ]]; then
echo "${version_autopilot_string} is not 0.0.50"
exit 1
fi
- name: va_0_0_51 patch incrementor test
id: va_0_0_51
uses: ./dist/apps/version-autopilot
env:
PATCH_OVERRIDE: 1
with:
major: 0
minor: 0
shift: 50
- name: assert_va_0_0_51 patch incrementor test
run: |
set -ex
version_autopilot_string_recommended=${{ steps.va_0_0_51.outputs.version_autopilot_string_recommended }}
version_autopilot_string=${{ steps.va_0_0_51.outputs.version_autopilot_string }}
version_autopilot_code=${{ steps.va_0_0_51.outputs.version_autopilot_code }}
if [[ "${version_autopilot_code}" != "51" ]]; then
echo "${version_autopilot_code} is not 51"
exit 1
fi
if [[ "${version_autopilot_string}" != "0.0.51" ]]; then
echo "${version_autopilot_string} is not 0.0.51"
exit 1
fi
- name: va_0_1_0 patch minor rollover
id: va_0_1_0
uses: ./dist/apps/version-autopilot
env:
PATCH_OVERRIDE: 51
with:
major: 0
minor: 0
shift: 50
- name: assert_va_0_1_0 patch minor rollover
run: |
set -ex
version_autopilot_string_recommended=${{ steps.va_0_1_0.outputs.version_autopilot_string_recommended }}
version_autopilot_string=${{ steps.va_0_1_0.outputs.version_autopilot_string }}
version_autopilot_code=${{ steps.va_0_1_0.outputs.version_autopilot_code }}
if [[ "${version_autopilot_code}" != "101" ]]; then
echo "${version_autopilot_code} is not 101"
exit 1
fi
if [[ "${version_autopilot_string}" != "0.1.1" ]]; then
echo "${version_autopilot_string} is not 0.1.1"
exit 1
fi
- name: va_1_0_0 patch major rollover
id: va_1_0_0
uses: ./dist/apps/version-autopilot
env:
PATCH_OVERRIDE: 51
with:
major: 0
minor: 99
shift: 50
- name: assert_va_1_0_0 patch major rollover
run: |
set -ex
version_autopilot_string_recommended=${{ steps.va_1_0_0.outputs.version_autopilot_string_recommended }}
version_autopilot_string=${{ steps.va_1_0_0.outputs.version_autopilot_string }}
version_autopilot_code=${{ steps.va_1_0_0.outputs.version_autopilot_code }}
if [[ "${version_autopilot_code}" != "10001" ]]; then
echo "${version_autopilot_code} is not 10001"
exit 1
fi
if [[ "${version_autopilot_string}" != "1.0.1" ]]; then
echo "${version_autopilot_string} is not 1.0.1"
exit 1
fi