Skip to content

Commit

Permalink
build: Update GitHub Actions to use newer versions and revise build c…
Browse files Browse the repository at this point in the history
…ommands
  • Loading branch information
felipebz committed Jan 30, 2024
1 parent 400eae2 commit f4237dd
Showing 1 changed file with 22 additions and 28 deletions.
50 changes: 22 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,82 +20,76 @@ jobs:
- LATEST_RELEASE
- DEV
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
11
17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build publishToMavenLocal --refresh-dependencies
run: ./gradlew build publishToMavenLocal --refresh-dependencies

- name: Build custom rules example
uses: gradle/gradle-build-action@v2
with:
arguments: build
build-root-directory: plsql-custom-rules
run: ./gradlew build -p plsql-custom-rules

- name: Run integration test
uses: gradle/gradle-build-action@v2
with:
arguments: integrationTest -Dsonar.runtimeVersion=${{ matrix.sqVersion }} --info
run: ./gradlew integrationTest -Dsonar.runtimeVersion=${{ matrix.sqVersion }} --info

windows-build:
name: Test on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: test
run: ./gradlew test

linux-build:
name: Build and release
needs: [integration-tests, windows-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 11

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build --refresh-dependencies
run: ./gradlew build --refresh-dependencies

- if: github.ref == 'refs/heads/main'
name: Run SonarQube Scanner
uses: gradle/gradle-build-action@v2
with:
arguments: sonar
run: ./gradlew sonar
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- if: github.ref == 'refs/heads/main'
name: Release artifacts
uses: gradle/gradle-build-action@v2
with:
arguments: publish jreleaserFullRelease
run: ./gradlew publish jreleaserFullRelease
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
Expand Down

0 comments on commit f4237dd

Please sign in to comment.