Skip to content

Commit

Permalink
Create matrixed CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Feb 29, 2024
1 parent 16b6400 commit 9d4894f
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 57 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI Build
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
ci-build:
strategy:
matrix:
os:
- id: ubuntu22-8-32
name: Linux
- id: windows-latest
name: Windows
java:
- version: 17
toolchain: false
- version: 21
toolchain: true
name: '${{ matrix.os.name}} | Java ${{ matrix.java.version}}'
runs-on: ${{ matrix.os.id }}
steps:
- name: Set up Java 17 and ${{ matrix.java.version }}
if: ${{ matrix.java.toolchain}}
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: |
${{ matrix.java.version }}
17
- name: Set up Java ${{ matrix.java.version }}
if: ${{ !matrix.java.toolchain}}
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: ${{ matrix.java.version }}
- name: Prepare Windows runner
if: ${{ runner.os == 'Windows' }}
run: |
git config --global core.autocrlf true
git config --global core.longPaths true
Stop-Service -name Docker
- name: Check out code
uses: actions/checkout@v4
- name: Set up Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5
with:
cache-read-only: false
- name: Configure Gradle properties
shell: bash
run: |
mkdir -p $HOME/.gradle
echo 'systemProp.user.name=spring-builds+github' >> $HOME/.gradle/gradle.properties
echo 'systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false' >> $HOME/.gradle/gradle.properties
echo 'org.gradle.daemon=false' >> $HOME/.gradle/gradle.properties
- name: Configure toolchain properties
if: ${{ matrix.java.toolchain }}
shell: bash
run: |
echo 'toolchainVersion=${{ matrix.java.version }}' >> $HOME/.gradle/gradle.properties
echo 'systemProp.org.gradle.java.installations.auto-detect=false' >> $HOME/.gradle/gradle.properties
echo 'systemProp.org.gradle.java.installations.auto-download=false' >> $HOME/.gradle/gradle.properties
echo 'systemProp.org.gradle.java.installations.paths=${{ github.env[format('JAVA_HOME_{0}_X64', matrix.java.version)] }}' >> $HOME/.gradle/gradle.properties
- name: Build
id: build
env:
CI: 'true'
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: ./gradlew --version
57 changes: 0 additions & 57 deletions .github/workflows/windows-build.yml

This file was deleted.

0 comments on commit 9d4894f

Please sign in to comment.