Publish to maven central #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build on PR | ||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
jobs: | ||
build: | ||
name: Build on Java ${{ matrix.java }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: ["8", "11", "17", "21"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{ matrix.java }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: ${{ matrix.java }} | ||
- name: Setup Gradle and publish build scans | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Set TERM variable for gradle | ||
run: echo "TERM=dumb" >> $GITHUB_ENV | ||
- name: Display environment info | ||
run: | | ||
./gradlew -v | ||
uname -a | ||
- name: Clean previous gradle builds | ||
run: ./gradlew clean -q -S | ||
- name: Run build with Gradle wrapper | ||
run: ./gradlew build -q -S | ||
- name: Remove Gradle cache lock file | ||
if: always() | ||
run: rmv -f $HOME/.gradle/caches/modules-2/modules-2.lock | ||
test: | ||
needs: build | ||
name: Build on Java 17 | ||
runs-on: ubuntu-latest | ||
cache-read-only: true | ||
Check failure on line 56 in .github/workflows/build.yml
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
- name: Setup Gradle and publish build scans | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
build-scan-publish: true | ||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | ||
build-scan-terms-of-use-agree: "yes" | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Set TERM variable for gradle | ||
run: echo "TERM=dumb" >> $GITHUB_ENV | ||
- name: Display environment info | ||
run: | | ||
./gradlew -v | ||
uname -a | ||
- name: Run tests with Gradle wrapper | ||
run: ./gradlew test -S | ||
- name: Remove Gradle cache lock file | ||
if: always() | ||
run: rmv -f $HOME/.gradle/caches/modules-2/modules-2.lock | ||
review: | ||
needs: test | ||
name: Code Review | ||
runs-on: ubuntu-latest | ||
cache-read-only: true | ||
steps: | ||
- name: Code coverage reports by Codecov | ||
uses: codecov/codecov-action@v4.0.1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: VenomVendor/NullDefense |