diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2518a669..85f54456 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,9 +8,41 @@ on: branches: - main +env: + JAVA_VERSION: 21 + jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ env.JAVA_VERSION }} + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + run: ./gradlew build publishToMavenLocal + + - name: Build custom rules example + run: ./gradlew build -p plsql-custom-rules + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: '**/build/' + integration-tests: name: IT + needs: build runs-on: ubuntu-latest strategy: fail-fast: false @@ -27,16 +59,15 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 21 + java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Build with Gradle - run: ./gradlew build publishToMavenLocal -x dokkaJavadoc -x test --refresh-dependencies - - - name: Build custom rules example - run: ./gradlew build -p plsql-custom-rules + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts - if: ${{ !contains(matrix.sqVersion, 'SNAPSHOT') }} name: Run integration test @@ -52,26 +83,9 @@ jobs: env: AUTH_REPOSITORY: ${{ secrets.AUTH_REPOSITORY }} - windows-build: - name: Test on Windows - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build with Gradle - run: ./gradlew test - - linux-build: - name: Build and release - needs: [integration-tests, windows-build] + release: + name: Release + needs: integration-tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -81,14 +95,11 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 21 + java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - - name: Build with Gradle - run: ./gradlew build --refresh-dependencies - - if: github.ref == 'refs/heads/main' name: Run SonarQube Scanner run: ./gradlew sonar --info @@ -116,7 +127,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 21 + java-version: ${{ env.JAVA_VERSION }} - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@v3