Skip to content

add a discrete job in CI for publishing to mavenLocal, then cache it #668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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