diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2dd2c1b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,102 @@ +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: 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 -i -S + + - name: Remove Gradle cache lock file + if: always() + run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock + + review: + needs: test + name: Code Review + runs-on: ubuntu-latest + steps: + - name: Code coverage reports by Codecov + uses: codecov/codecov-action@v4.0.1 + with: + name: Branch Coverage + codecov_yml_path: .codecov.yml + token: ${{ secrets.CODECOV_TOKEN }} + slug: VenomVendor/NullDefense + file: ./build/reports/jacoco/report.xml + fail_ci_if_error: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3abef16 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,61 @@ +name: Publish on Change + +on: + push: + branches: [ $default-branch ] + +jobs: + publish: + name: Publish artifacts + 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 build -q -S + ./gradlew publish + + - name: Remove Gradle cache lock file + if: always() + run: rm -rvf $HOME/.gradle/caches/modules-2/modules-2.lock + + coverage: + name: Code Coverage + needs: publish + runs-on: ubuntu-latest + steps: + - name: Code coverage reports by Codecov + uses: codecov/codecov-action@v4.0.1 + with: + name: Full Coverage + codecov_yml_path: .codecov.yml + token: ${{ secrets.CODECOV_TOKEN }} + slug: VenomVendor/NullDefense + file: ./build/reports/jacoco/report.xml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f1da278..0000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -language: java -jdk: oraclejdk8 -sudo: false - -env: - global: - # BINTRAY_USER - - secure: "2L4QIYMp2/PpzVSDrUKhscbErn+B7h/qpQkgBi4YS/UQ6qb5vd/IqQKpaDeFDaj8KUW1H/7PFYuNOZnnH41aZdhc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I1r8GH5O+5r+7Ti6kUtQDcvg98beKrmYun3kAoHmqKEMuqOfdHWjqlkwhPN1XhFFF0YHEiGEzG4OhWEuZD9ydM+ZJbeu48oW6yFngRNl7XTljB1/ReowDsY9wuYAITM5sDmefdLcm7q7dYCZrfNaCjm6SurHN+s5BVT7wrtgzgMrhesD4x6JGDkqVgWJoRgVZ6pe4pAXyOQmzHFiz98FNxjCxS8f4+r7fCFcMKiGZVEjBjRqoxYFtJoCxeVdTJ/nJCnkeIJinBdfpTCs6aLwK4YCynGCbIJfHW39L097hT/A5c0OrP0s9mzCShIAPzY8F3idrbsHLYemff42kYJWYnBoCGciN7qpLpOCtcWZrWspAaoNZ+2j8/wiWlmRdvKB4R+nQHCWDyGdjNF0AvRvwVdkjvzI+NloQkSoWCTPJbnxnZa+Roy7GHFl7eVfygHZZZQm00TYKsJBGZI2UU/E2mWzgOp2cSb50wjeE2E0VsAofWtCdzjSJAS6S4FWq5//kxnTkLBVGg=" - -branches: - only: - - master - - "^feature\\/.*$" - -cache: - directories: - - "$HOME/.m2" - - "$HOME/.gradle" - -notifications: - email: false - -before_install: -# for gradle output style -- export TERM=dumb -- chmod +x gradlew -# environment info -- "./gradlew -v" -- uname -a -- wget -O ~/codacy-coverage-reporter-assembly-latest.jar "https://github.com/codacy/codacy-coverage-reporter/releases/download/4.0.2/codacy-coverage-reporter-4.0.2-assembly.jar" - -before_script: -- "./gradlew --stop" -- "./gradlew clean" -- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter -- chmod +x ./cc-test-reporter -- ./cc-test-reporter before-build - -script: -- "./gradlew publish bintrayUpload" - -after_script: -- JACOCO_SOURCE_PATH=src/main/java ./cc-test-reporter format-coverage build/reports/jacoco/report.xml --input-type jacoco -- ./cc-test-reporter upload-coverage - -before_cache: -- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - -after_success: -# Trigger codecov analysis -- bash <(curl -s https://codecov.io/bash) -# Trigger codacy analysis -- java -jar ~/codacy-coverage-reporter-assembly-latest.jar report -l Java -r build/reports/jacoco/report.xml -# Trigger Coveralls -- ./gradlew coveralls