1+ name : Build and test
2+ on :
3+ push :
4+ branches :
5+ - ' **'
6+ pull_request :
7+ branches :
8+ - ' master'
9+ workflow_call :
10+
11+ jobs :
12+ build :
13+ strategy :
14+ matrix :
15+ os : [ubuntu-latest, windows-latest, macos-latest]
16+ runs-on : ${{ matrix.os }}
17+ steps :
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : ' 22'
23+
24+ - name : Checkout
25+ uses : actions/checkout@v4
26+
27+ - name : Prepare java
28+ uses : actions/setup-java@v4
29+ with :
30+ distribution : ' zulu'
31+ java-version : ' 21'
32+
33+ - name : Install clojure tools
34+ uses : DeLaGuardo/setup-clojure@12.5
35+ with :
36+ cli : latest
37+ bb : latest
38+
39+ - name : Cache clojure/java dependencies
40+ uses : actions/cache@v4
41+ with :
42+ path : |
43+ ~/.m2/repository
44+ ~/.gitlibs
45+ ~/.deps.clj
46+ key : ${{ runner.os }}-clojure-${{ hashFiles('**/*.edn') }}
47+ restore-keys : |
48+ ${{ runner.os }}-clojure-
49+
50+ - name : Install node dependencies
51+ run : npm install
52+
53+ - name : Cache npm
54+ uses : actions/cache@v4
55+ with :
56+ path : ~/.npm
57+ key : ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
58+ restore-keys : |
59+ ${{ runner.os }}-npm-
60+
61+ - name : Build Pre-release VSIX
62+ if : startsWith(github.ref, 'refs/heads/')
63+ run : bb package-pre-release ${GITHUB_REF#refs/heads/}
64+
65+ - name : Build Release VSIX
66+ if : startsWith(github.ref, 'refs/tags/v')
67+ shell : bash
68+ run : |
69+ set -x
70+ npm run package
71+
72+ - name : Get VSIX File Name
73+ id : get-vsix-name
74+ shell : bash
75+ run : echo "VSIX_NAME=$(ls *.vsix)" >> $GITHUB_ENV
76+
77+ - name : Upload VSIX Artifact
78+ uses : actions/upload-artifact@v4
79+ with :
80+ name : ${{ runner.os }}-${{ env.VSIX_NAME }}
81+ path : ${{ env.VSIX_NAME }}
82+
83+ - name : Upload Test Artifact
84+ uses : actions/upload-artifact@v4
85+ with :
86+ name : ${{ runner.os }}-extension-tests
87+ path : out/extension-tests.js
88+
89+ test :
90+ strategy :
91+ matrix :
92+ os : [ubuntu-latest, windows-latest, macos-latest]
93+ runs-on : ${{ matrix.os }}
94+ needs : build
95+ steps :
96+ - name : Download Test Artifact
97+ uses : actions/download-artifact@v4
98+ with :
99+ name : ${{ runner.os }}-extension-tests
100+ pattern : out/extension-tests.js
101+ merge-multiple : true
102+ path : out/
103+
104+ - name : Run Tests
105+ run : node out/extension-tests.js
106+
107+ e2e-test :
108+ strategy :
109+ matrix :
110+ os : [ubuntu-latest, windows-latest, macos-latest]
111+ runs-on : ${{ matrix.os }}
112+ needs : build
113+ steps :
114+ - name : Checkout
115+ uses : actions/checkout@v4
116+
117+ - name : Download VSIX Artifact
118+ uses : actions/download-artifact@v4
119+ with :
120+ path : .
121+ pattern : ' ${{ runner.os }}-*.vsix'
122+ merge-multiple : true
123+
124+ - name : Get VSIX File Name
125+ id : get-vsix-name
126+ shell : bash
127+ run : echo "VSIX_NAME=$(ls *.vsix)" >> $GITHUB_ENV
128+
129+ - name : Setup Node.js
130+ uses : actions/setup-node@v4
131+ with :
132+ node-version : ' 22'
133+
134+ - name : Cache npm
135+ uses : actions/cache@v4
136+ with :
137+ path : ~/.npm
138+ key : ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
139+ restore-keys : |
140+ ${{ runner.os }}-npm-
141+
142+ - name : Install node dependencies
143+ run : npm install
144+
145+ - name : Setup Babashka
146+ uses : DeLaGuardo/setup-clojure@12.5
147+ with :
148+ bb : latest
149+
150+ - name : Run E2E Tests Unix
151+ if : runner.os != 'Windows'
152+ uses : coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
153+ with :
154+ run : bb run-e2e-tests-vsix ${{ env.VSIX_NAME }}
155+
156+ - name : Run E2E Tests Windows
157+ if : runner.os == 'Windows'
158+ shell : bash
159+ run : bb run-e2e-tests-vsix ${{ env.VSIX_NAME }}
160+
161+ lint :
162+ runs-on : ubuntu-latest
163+ needs : build
164+ steps :
165+ - name : Checkout
166+ uses : actions/checkout@v4
167+
168+ - name : Install clojure tools
169+ uses : DeLaGuardo/setup-clojure@12.5
170+ with :
171+ clj-kondo : latest
172+
173+ - name : Linting that sparks joy
174+ run : |
175+ clj-kondo --version
176+ clj-kondo --lint src test --fail-level warning
177+
178+ check-format :
179+ runs-on : ubuntu-latest
180+ needs : build
181+ steps :
182+ - name : Checkout
183+ uses : actions/checkout@v4
184+
185+ - name : Install clojure tools
186+ uses : DeLaGuardo/setup-clojure@12.5
187+ with :
188+ cljfmt : latest
189+
190+ - name : Check formatting
191+ run : |
192+ cljfmt --version
193+ cljfmt check
0 commit comments