Skip to content

Commit b5e067f

Browse files
authored
Combine pre/main/post into single run entrypoint (#68)
1 parent 3199aaa commit b5e067f

File tree

9 files changed

+108
-121
lines changed

9 files changed

+108
-121
lines changed

.github/workflows/smoke-tests.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414

1515
steps:
16+
- name: Checkout
17+
uses: actions/checkout@master
18+
1619
- name: Prepare java
1720
uses: actions/setup-java@v3
1821
with:
1922
distribution: 'zulu'
2023
java-version: '8'
2124

2225
- name: Install clojure tools-deps
23-
uses: DeLaGuardo/setup-clojure@main
24-
# uses: ./
26+
uses: ./
2527
with:
2628
tools-deps: 1.10.1.693
2729

@@ -36,15 +38,17 @@ jobs:
3638
runs-on: ${{ matrix.os }}
3739

3840
steps:
41+
- name: Checkout
42+
uses: actions/checkout@master
43+
3944
- name: Prepare java
4045
uses: actions/setup-java@v3
4146
with:
4247
distribution: 'zulu'
4348
java-version: '8'
4449

4550
- name: Install Clojure CLI
46-
uses: DeLaGuardo/setup-clojure@main
47-
# uses: ./
51+
uses: ./
4852
with:
4953
cli: 1.10.1.693
5054

@@ -59,15 +63,17 @@ jobs:
5963
runs-on: ${{ matrix.os }}
6064

6165
steps:
66+
- name: Checkout
67+
uses: actions/checkout@master
68+
6269
- name: Prepare java
6370
uses: actions/setup-java@v3
6471
with:
6572
distribution: 'zulu'
6673
java-version: '8'
6774

6875
- name: Install leiningen
69-
uses: DeLaGuardo/setup-clojure@main
70-
# uses: ./
76+
uses: ./
7177
with:
7278
lein: 2.9.1
7379
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -83,15 +89,17 @@ jobs:
8389
runs-on: ${{ matrix.os }}
8490

8591
steps:
92+
- name: Checkout
93+
uses: actions/checkout@master
94+
8695
- name: Prepare java
8796
uses: actions/setup-java@v3
8897
with:
8998
distribution: 'zulu'
9099
java-version: '11'
91100

92101
- name: Install boot
93-
uses: DeLaGuardo/setup-clojure@main
94-
# uses: ./
102+
uses: ./
95103
with:
96104
boot: 2.8.3
97105
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -107,15 +115,17 @@ jobs:
107115
runs-on: ${{ matrix.os }}
108116

109117
steps:
118+
- name: Checkout
119+
uses: actions/checkout@master
120+
110121
- name: Prepare java
111122
uses: actions/setup-java@v3
112123
with:
113124
distribution: 'zulu'
114125
java-version: '8'
115126

116127
- name: Install babashka
117-
uses: DeLaGuardo/setup-clojure@main
118-
# uses: ./
128+
uses: ./
119129
with:
120130
bb: latest
121131
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -131,15 +141,17 @@ jobs:
131141
runs-on: ${{ matrix.os }}
132142

133143
steps:
144+
- name: Checkout
145+
uses: actions/checkout@master
146+
134147
- name: Prepare java
135148
uses: actions/setup-java@v3
136149
with:
137150
distribution: 'zulu'
138151
java-version: '8'
139152

140153
- name: Install clj-kondo
141-
uses: DeLaGuardo/setup-clojure@main
142-
# uses: ./
154+
uses: ./
143155
with:
144156
clj-kondo: latest
145157
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -155,15 +167,17 @@ jobs:
155167
runs-on: ${{ matrix.os }}
156168

157169
steps:
170+
- name: Checkout
171+
uses: actions/checkout@master
172+
158173
- name: Prepare java
159174
uses: actions/setup-java@v3
160175
with:
161176
distribution: 'zulu'
162177
java-version: '8'
163178

164179
- name: Install cljstyle
165-
uses: DeLaGuardo/setup-clojure@main
166-
# uses: ./
180+
uses: ./
167181
with:
168182
cljstyle: latest
169183
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -180,15 +194,17 @@ jobs:
180194
runs-on: ${{ matrix.os }}
181195

182196
steps:
197+
- name: Checkout
198+
uses: actions/checkout@master
199+
183200
- name: Prepare java
184201
uses: actions/setup-java@v3
185202
with:
186203
distribution: 'zulu'
187204
java-version: '8'
188205

189206
- name: Install zprint
190-
uses: DeLaGuardo/setup-clojure@main
191-
# uses: ./
207+
uses: ./
192208
with:
193209
zprint: latest
194210
github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -200,15 +216,17 @@ jobs:
200216
runs-on: ubuntu-latest
201217

202218
steps:
219+
- name: Checkout
220+
uses: actions/checkout@master
221+
203222
- name: Prepare java
204223
uses: actions/setup-java@v3
205224
with:
206225
distribution: 'zulu'
207226
java-version: '8'
208227

209228
- name: Install all the tools
210-
uses: DeLaGuardo/setup-clojure@main
211-
# uses: ./
229+
uses: ./
212230
with:
213231
cli: 1.11.1.1149
214232
lein: 2.9.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
java-version: '8'
4646

4747
- name: Install clojure tools
48-
uses: DeLaGuardo/setup-clojure@9.3
48+
uses: DeLaGuardo/setup-clojure@9.4
4949
with:
5050
# Install just one or all simultaneously
5151
# The value must indicate a particular version of the tool, or use 'latest'

__tests__/entrypoint.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as _cljKondo from '../src/clj-kondo'
77
import * as _cljstyle from '../src/cljstyle'
88
import * as _zprint from '../src/zprint'
99
import * as _utils from '../src/utils'
10-
import {run} from '../src/entrypoint'
10+
import {main} from '../src/entrypoint'
1111

1212
jest.mock('@actions/core')
1313
const core: jest.Mocked<typeof _core> = _core as never
@@ -50,7 +50,7 @@ describe('setup-clojure', () => {
5050
inputs['lein'] = '1.2.3'
5151
inputs['github-token'] = 'abc'
5252

53-
await run()
53+
await main()
5454

5555
expect(lein.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
5656
})
@@ -59,23 +59,23 @@ describe('setup-clojure', () => {
5959
inputs['boot'] = '1.2.3'
6060
inputs['github-token'] = 'abc'
6161

62-
await run()
62+
await main()
6363

6464
expect(boot.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
6565
})
6666

6767
it('sets up Clojure CLI tools from deprecated `tools-deps` option', async () => {
6868
inputs['tools-deps'] = '1.2.3'
6969

70-
await run()
70+
await main()
7171

7272
expect(cli.setup).toHaveBeenCalledWith('1.2.3')
7373
})
7474

7575
it('sets up Clojure CLI tools', async () => {
7676
inputs['cli'] = '1.2.3'
7777

78-
await run()
78+
await main()
7979

8080
expect(cli.setup).toHaveBeenCalledWith('1.2.3')
8181
})
@@ -84,7 +84,7 @@ describe('setup-clojure', () => {
8484
inputs['bb'] = '1.2.3'
8585
inputs['github-token'] = 'abc'
8686

87-
await run()
87+
await main()
8888

8989
expect(bb.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
9090
})
@@ -93,7 +93,7 @@ describe('setup-clojure', () => {
9393
inputs['clj-kondo'] = '1.2.3'
9494
inputs['github-token'] = 'abc'
9595

96-
await run()
96+
await main()
9797

9898
expect(cljKondo.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
9999
})
@@ -102,7 +102,7 @@ describe('setup-clojure', () => {
102102
inputs['cljstyle'] = '1.2.3'
103103
inputs['github-token'] = 'abc'
104104

105-
await run()
105+
await main()
106106

107107
expect(cljstyle.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
108108
})
@@ -112,15 +112,15 @@ describe('setup-clojure', () => {
112112
inputs['github-token'] = 'abc'
113113
utils.isWindows.mockReturnValue(true)
114114

115-
await run()
115+
await main()
116116

117117
expect(core.setFailed).toHaveBeenCalledWith(
118118
'cljstyle on windows is not supported yet.'
119119
)
120120
})
121121

122122
it('throws if none of Clojure tools is specified', async () => {
123-
await run()
123+
await main()
124124
expect(core.setFailed).toHaveBeenCalledWith(
125125
'You must specify at least one clojure tool.'
126126
)
@@ -130,15 +130,15 @@ describe('setup-clojure', () => {
130130
inputs['bb'] = '1.2.3'
131131
bb.setup.mockRejectedValueOnce('Unknown failure')
132132

133-
await run()
133+
await main()
134134
expect(core.setFailed).toHaveBeenCalledWith('Unknown failure')
135135
})
136136

137137
it('sets up zprint', async () => {
138138
inputs['zprint'] = '1.2.3'
139139
inputs['github-token'] = 'abc'
140140

141-
await run()
141+
await main()
142142

143143
expect(zprint.setup).toHaveBeenCalledWith('1.2.3', 'token abc')
144144
})

action.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,3 @@ inputs:
4444
runs:
4545
using: 'node16'
4646
main: 'dist/index.js'
47-
pre: 'dist/index.js'
48-
post: 'dist/index.js'

0 commit comments

Comments
 (0)