From 827cfb4954ac305d4b569e2bd2a4885c93970efc Mon Sep 17 00:00:00 2001 From: Tom Akehurst Date: Wed, 9 Oct 2024 17:02:21 +0100 Subject: [PATCH] Removed redundant Actions workflow and fixed build error --- .github/workflows/build-and-test.yml | 23 +++++++++-- .github/workflows/gradle.yml | 60 ---------------------------- 2 files changed, 19 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index aea0bdf..b4e109b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,4 +1,4 @@ -name: Gradle CI +name: Build and test with Gradle on: [workflow_dispatch, workflow_call, push, pull_request] @@ -24,16 +24,31 @@ jobs: with: distribution: 'zulu' java-version: ${{ matrix.java }} - - name: "Gradle build" + - name: "Build and test" shell: bash run: | java -version javac -version - ./gradlew --no-daemon build + ./gradlew --no-daemon check - name: Publish Build uses: actions/upload-artifact@v4 if: failure() with: name: build-${{ github.run_number }}-${{ matrix.java }} - path: ${{ github.workspace }} \ No newline at end of file + path: ${{ github.workspace }} + + gradle-scan: + name: Snyk gradle scan + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run Snyk to check build.gradle for vulnerabilities + uses: snyk/actions/gradle-jdk17@master + env: + SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} + with: + command: test + args: --severity-threshold=high --org=f310ee2f-5552-444d-84ee-ec8c44c33adb \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index 8f87b78..0000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Java CI with Gradle - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - jdk: [17, 21] - runs-on: ${{ matrix.os }} - env: - JDK_VERSION: ${{ matrix.jdk }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: ${{ matrix.jdk }} - distribution: 'temurin' - - - name: Grant execute permission for gradlew - run: chmod +x gradlew - - - name: Cache Gradle packages - uses: actions/cache@v1 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - - name: Test with Gradle - run: ./gradlew check --stacktrace --no-daemon - - gradle-scan: - name: Snyk gradle scan - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Run Snyk to check build.gradle for vulnerabilities - uses: snyk/actions/gradle-jdk17@master - env: - SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} - with: - command: test - args: --severity-threshold=high --org=f310ee2f-5552-444d-84ee-ec8c44c33adb