Skip to content

Commit

Permalink
add a discrete job in CI for publishing to mavenLocal, then cache it
Browse files Browse the repository at this point in the history
  • Loading branch information
RBusarow authored and kodiakhq[bot] committed May 23, 2022
1 parent 6f5e7bb commit a650961
Showing 1 changed file with 70 additions and 33 deletions.
103 changes: 70 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,6 @@ jobs:
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

website:
name: build website
runs-on: ubuntu-latest
steps:

- name: Check out repo
uses: actions/checkout@v3

# Node is required for npm
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
cache-dependency-path: website/yarn.lock

- name: Install Yarn
working-directory: website
run: |
yarn install --frozen-lockfile
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'gradle'

- uses: gradle/wrapper-validation-action@v1

- name: build website
run: ./gradlew buildSite --no-daemon

static-analysis:

runs-on: ubuntu-latest
Expand Down Expand Up @@ -226,9 +193,78 @@ jobs:
commit_message: update website versions
commit_options: '--no-verify --signoff'

publish-maven-local:

runs-on: ubuntu-latest

steps:
- name: check out with token (used by forks)
uses: actions/checkout@v3
if: github.event.pull_request.head.repo.full_name != github.repository

- name: check out with PAT (used by main repo)
uses: actions/checkout@v3
if: github.event.pull_request.head.repo.full_name == github.repository
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fetch-depth: 0

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'gradle'

- name: publish to maven local and build tests
uses: burrunan/gradle-cache-action@v1
with:
gradle-dependencies-cache-key: gradle/libs.versions.toml
arguments: |
publishToMavenLocal
buildTests
concurrent: true
gradle-build-scan-report: false

website:
name: build website
runs-on: ubuntu-latest
needs: publish-maven-local
steps:

- name: Check out repo
uses: actions/checkout@v3

# Node is required for npm
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: yarn
cache-dependency-path: website/yarn.lock

- name: Install Yarn
working-directory: website
run: |
yarn install --frozen-lockfile
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
cache: 'gradle'

- uses: gradle/wrapper-validation-action@v1

- name: build website
run: ./gradlew buildSite --no-daemon

tests-ubuntu:

runs-on: ubuntu-latest
needs: publish-maven-local

steps:
- name: check out with token (used by forks)
Expand Down Expand Up @@ -276,6 +312,7 @@ jobs:
tests-windows:

runs-on: windows-latest
needs: publish-maven-local

steps:

Expand Down

0 comments on commit a650961

Please sign in to comment.