Skip to content

Commit

Permalink
Merge pull request #106 from sbesson/gradle_workflow_fixes
Browse files Browse the repository at this point in the history
CI workflow fixes (Gradle, outdated actions)
  • Loading branch information
sbesson authored Mar 7, 2023
2 parents 2f0f734 + ceeafdc commit a045d97
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 25 deletions.
25 changes: 9 additions & 16 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ jobs:
build:
strategy:
matrix:
java: [1.8, 11]
java: [8, 11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
gradle_version: # set to empty to build with most recent version of gradle
gradle_version: 7.6 # set to empty to build with most recent version of gradle
gradle_commands: publishToMavenLocal exec # default is build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Cache Gradle packages
uses: actions/cache@v2
distribution: 'zulu'
cache: 'gradle'
- uses: gradle/gradle-build-action@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Wrap with specified version
run: gradle wrapper --gradle-version=${{ env.gradle_version }}
if: ${{ env.gradle_version != '' }}
- name: Wrap without version
run: gradle wrapper
if: ${{ env.gradle_version == '' }}
gradle-version: ${{ env.gradle_version }}
- name: Run commands
run: ./gradlew ${{ env.gradle_commands }}
run: gradle ${{ env.gradle_commands }}
14 changes: 5 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@ jobs:
build:
strategy:
matrix:
java: [1.8, 11]
java: [8, 11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
maven_commands: install # default is install
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
distribution: 'zulu'
cache: 'maven'
- name: Build
run: mvn ${{ env.maven_commands }}
deploy:
Expand Down

0 comments on commit a045d97

Please sign in to comment.