Skip to content

Commit a650961

Browse files
RBusarowkodiakhq[bot]
authored andcommitted
add a discrete job in CI for publishing to mavenLocal, then cache it
1 parent 6f5e7bb commit a650961

1 file changed

Lines changed: 70 additions & 33 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,6 @@ jobs:
1818
env:
1919
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
2020

21-
website:
22-
name: build website
23-
runs-on: ubuntu-latest
24-
steps:
25-
26-
- name: Check out repo
27-
uses: actions/checkout@v3
28-
29-
# Node is required for npm
30-
- name: Set up Node
31-
uses: actions/setup-node@v3
32-
with:
33-
node-version: 14.x
34-
cache: yarn
35-
cache-dependency-path: website/yarn.lock
36-
37-
- name: Install Yarn
38-
working-directory: website
39-
run: |
40-
yarn install --frozen-lockfile
41-
42-
- name: Set up JDK
43-
uses: actions/setup-java@v3
44-
with:
45-
distribution: 'adopt'
46-
java-version: '11'
47-
cache: 'gradle'
48-
49-
- uses: gradle/wrapper-validation-action@v1
50-
51-
- name: build website
52-
run: ./gradlew buildSite --no-daemon
53-
5421
static-analysis:
5522

5623
runs-on: ubuntu-latest
@@ -226,9 +193,78 @@ jobs:
226193
commit_message: update website versions
227194
commit_options: '--no-verify --signoff'
228195

196+
publish-maven-local:
197+
198+
runs-on: ubuntu-latest
199+
200+
steps:
201+
- name: check out with token (used by forks)
202+
uses: actions/checkout@v3
203+
if: github.event.pull_request.head.repo.full_name != github.repository
204+
205+
- name: check out with PAT (used by main repo)
206+
uses: actions/checkout@v3
207+
if: github.event.pull_request.head.repo.full_name == github.repository
208+
with:
209+
ref: ${{ github.event.pull_request.head.ref }}
210+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
211+
fetch-depth: 0
212+
213+
- name: Set up JDK
214+
uses: actions/setup-java@v3
215+
with:
216+
distribution: 'adopt'
217+
java-version: '11'
218+
cache: 'gradle'
219+
220+
- name: publish to maven local and build tests
221+
uses: burrunan/gradle-cache-action@v1
222+
with:
223+
gradle-dependencies-cache-key: gradle/libs.versions.toml
224+
arguments: |
225+
publishToMavenLocal
226+
buildTests
227+
concurrent: true
228+
gradle-build-scan-report: false
229+
230+
website:
231+
name: build website
232+
runs-on: ubuntu-latest
233+
needs: publish-maven-local
234+
steps:
235+
236+
- name: Check out repo
237+
uses: actions/checkout@v3
238+
239+
# Node is required for npm
240+
- name: Set up Node
241+
uses: actions/setup-node@v3
242+
with:
243+
node-version: 14.x
244+
cache: yarn
245+
cache-dependency-path: website/yarn.lock
246+
247+
- name: Install Yarn
248+
working-directory: website
249+
run: |
250+
yarn install --frozen-lockfile
251+
252+
- name: Set up JDK
253+
uses: actions/setup-java@v3
254+
with:
255+
distribution: 'adopt'
256+
java-version: '11'
257+
cache: 'gradle'
258+
259+
- uses: gradle/wrapper-validation-action@v1
260+
261+
- name: build website
262+
run: ./gradlew buildSite --no-daemon
263+
229264
tests-ubuntu:
230265

231266
runs-on: ubuntu-latest
267+
needs: publish-maven-local
232268

233269
steps:
234270
- name: check out with token (used by forks)
@@ -276,6 +312,7 @@ jobs:
276312
tests-windows:
277313

278314
runs-on: windows-latest
315+
needs: publish-maven-local
279316

280317
steps:
281318

0 commit comments

Comments
 (0)