-
Notifications
You must be signed in to change notification settings - Fork 1
163 lines (147 loc) · 3.84 KB
/
checks.yml
File metadata and controls
163 lines (147 loc) · 3.84 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Checks
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main, "version/*"]
jobs:
check:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
# When we develop this internally we have to go through the repo1 mirror
# When we run it in GitHub its running outside of the optum network and cant access repo1
# Ideally these lock files wouldn't store the repository in it but just the sha of the module
# For now we have to remove the lock file in order to install the dependencies in the ci server
- name: Install Dependencies
run: |
rm deno.lock
deno install --no-lock
- run: deno fmt --check
- run: deno lint
- run: deno task test
- id: parse_version
name: Get the Version
run: |
deno run -A main.ts get
- name: Print the Version
run: |
cat >> $GITHUB_STEP_SUMMARY<<EOF
# Version
\`\`\`
${{ steps.parse_version.outputs.version }}
\`\`\`
| part | value |
| ---------- | --- |
| version | \`${{ steps.parse_version.outputs.version }}\` |
| major | \`${{ steps.parse_version.outputs.major }}\` |
| minor | \`${{ steps.parse_version.outputs.minor }}\` |
| patch | \`${{ steps.parse_version.outputs.patch }}\` |
| prerelease | \`${{ steps.parse_version.outputs.prerelease || ' ' }}\` |
| build | \`${{ steps.parse_version.outputs.build || ' ' }}\` |
EOF
test-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./setup
with:
version: 1.0.10
- name: Default
uses: ./
- name: Get
uses: ./
with:
command: get
- name: Set
uses: ./
with:
command: set
value: 1.2.3
- name: Inc Major
uses: ./
with:
command: inc
sub-command: major
- name: Inc Minor
uses: ./
with:
command: inc
sub-command: minor
- name: Inc Patch
uses: ./
with:
command: inc
sub-command: patch
- name: Inc None
uses: ./
with:
command: inc
sub-command: none
- name: Parse
uses: ./
with:
command: parse
value: 1.2.3-alpha.1+build.123
- name: Equal
uses: ./
with:
command: eq
value: 1.2.3
compare-to: 1.2.3
- name: Compare
uses: ./
with:
command: cmp
value: 1.2.3
compare-to: 1.2.3
- name: Greater Than
uses: ./
with:
command: gt
value: 1.2.3
compare-to: 1.0.0
- name: Greater Than or Equal
uses: ./
with:
command: gte
value: 1.2.3
compare-to: 1.2.3
- name: Less Than
uses: ./
with:
command: lt
value: 1.2.3
compare-to: 2.0.0
- name: Less Than or Equal
uses: ./
with:
command: lte
value: 1.2.3
compare-to: 1.2.3
- name: Sort
uses: ./
with:
command: sort
value: 2.0.0 1.0.0 3.0.0
docker:
runs-on: ubuntu-latest
needs:
- check
- test-action
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v4
with:
push: false
tags: optum/semver-cli:pr
platforms: linux/amd64