-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (117 loc) · 3.25 KB
/
test.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
name: "Test Action"
on:
push:
branches:
- "**"
jobs:
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- name: Run unit tests
run: npm run test
test-integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install Javascript dependencies using npm
if: ${{ github.ref != 'refs/heads/release' }}
run: npm install
- name: Package action for integration tests
if: ${{ github.ref != 'refs/heads/release' }}
run: npm run package
- id: major
uses: ./
with:
version: "3.14.1"
major: true
minor: false
patch: false
- name: Test major version is provided as alias
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: "v3"
actual: "${{ steps.major.outputs.csv }}"
- id: minor
uses: ./
with:
version: "3.14.1"
major: false
minor: true
patch: false
- name: Test minor version is provided as alias
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: "v3.14"
actual: "${{ steps.minor.outputs.csv }}"
- id: patch
uses: ./
with:
version: "3.14.1"
major: false
minor: false
patch: true
- name: Test patch version is provided as alias
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: "v3.14.1"
actual: "${{ steps.patch.outputs.csv }}"
- id: all
uses: ./
with:
version: "3.14.1"
major: true
minor: true
patch: true
- name: Test all versions are provided as aliases
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: "v3,v3.14,v3.14.1"
actual: "${{ steps.all.outputs.csv }}"
- name: Test list provides new-line separated aliases
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: |
v3
v3.14
v3.14.1
actual: "${{ steps.all.outputs.list }}"
- id: none
uses: ./
with:
version: "3.14.1"
major: false
minor: false
patch: false
- name: Test no versions are provided as aliases
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/is-equal
expected: ""
actual: "${{ steps.none.outputs.csv }}"
- id: prefixed
uses: ./
with:
version: "3.14.1"
major: true
minor: true
patch: true
- name: Test all version aliases are prefixed
uses: prompt/actions-assert@v1
with:
assertion: npm://@assertions/starts-with
each: true
expected: "v"
actual: "${{ steps.prefixed.outputs.list }}"