Skip to content

Commit

Permalink
Optimized CI (#452)
Browse files Browse the repository at this point in the history
* Bump actions/checkout to v3
* Bump actions/setup-java to v3
* Use actions/setup-java to cache maven
* Disable publish jobs in forked repository
* Use temurin
  • Loading branch information
Goooler committed Mar 27, 2022
1 parent b017f82 commit 5748e1f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ jobs:
build:
name: Maven build
runs-on: ubuntu-18.04

strategy:
matrix:
maven-version:
- '3.3.9'
- '3.6.1'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: .github/scripts/build.sh
env:
Expand All @@ -50,14 +51,16 @@ jobs:
deploy:
name: Maven deploy
runs-on: ubuntu-18.04
if: github.repository == 'gantsign/ktlint-maven-plugin'
needs: build-all
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@ jobs:
build:
name: Maven build
runs-on: ubuntu-18.04

strategy:
matrix:
maven-version:
- '3.3.9'
- '3.6.1'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: .github/scripts/build.sh
env:
Expand All @@ -50,14 +51,16 @@ jobs:
deploy:
name: Maven deploy
runs-on: ubuntu-18.04
if: github.repository == 'gantsign/ktlint-maven-plugin'
needs: build-all
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
- name: Install GPG key
run: |-
gpg --batch --import-options import-show --import << EOF
Expand All @@ -81,14 +84,16 @@ jobs:
deploy-site:
name: Maven deploy site
runs-on: ubuntu-18.04
if: github.repository == 'gantsign/ktlint-maven-plugin'
needs: deploy
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
- name: Configure Git user
run: >-
git config --global user.name 'John Freeman' &&
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Verify

on:
pull_request: {}
pull_request:

env:
JAVA_TOOL_OPTIONS: >-
Expand All @@ -14,21 +14,22 @@ jobs:
build:
name: Maven build
runs-on: ubuntu-18.04

strategy:
matrix:
maven-version:
- '3.3.9'
- '3.6.1'
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: '1.8'
java-version: 8
distribution: 'temurin'
cache: 'maven'
- name: Build with Maven
run: .github/scripts/build.sh
env:
Expand Down

0 comments on commit 5748e1f

Please sign in to comment.