-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated from Travis CI to github actions
- Loading branch information
1 parent
a9f66ef
commit 8c604da
Showing
3 changed files
with
194 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
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", "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: Build using gradle | ||
run: ./gradlew build -q -S | ||
|
||
- name: Remove Gradle cache lock file | ||
if: always() | ||
run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock | ||
|
||
test: | ||
needs: build | ||
name: Test on Java 17 | ||
runs-on: ubuntu-latest | ||
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: | ||
cache-read-only: true | ||
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: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock | ||
|
||
- name: Code coverage reports by Codecov | ||
uses: codecov/[email protected] | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
codecov_yml_path: ./codecov.yml | ||
name: Branch Coverage | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: VenomVendor/NullDefense | ||
file: ./build/reports/jacoco/report.xml | ||
fail_ci_if_error: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Publish on Change | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
|
||
jobs: | ||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-latest | ||
environment: publish | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "21" | ||
distribution: "temurin" | ||
architecture: x64 | ||
|
||
- 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: Build using gradle | ||
run: | | ||
./gradlew test -q -S | ||
- name: Remove Gradle cache lock file | ||
if: always() | ||
run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock | ||
|
||
- name: Code coverage reports by Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
name: Full Coverage | ||
codecov_yml_path: ./codecov.yml | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: VenomVendor/NullDefense | ||
file: ./build/reports/jacoco/report.xml | ||
|
||
publish: | ||
name: Publish artifacts | ||
runs-on: ubuntu-latest | ||
environment: publish | ||
needs: coverage | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "21" | ||
distribution: "temurin" | ||
architecture: x64 | ||
|
||
- 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: Build using gradle | ||
run: | | ||
./gradlew build -q -S | ||
./gradlew publish | ||
- name: Remove Gradle cache lock file | ||
if: always() | ||
run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock |
This file was deleted.
Oops, something went wrong.