From dc75e0386a90beb641d1f7ad835cd7d8e15dd142 Mon Sep 17 00:00:00 2001 From: Anush Date: Thu, 14 Dec 2023 14:54:25 +0530 Subject: [PATCH] ci: deploy and test workflow updates (#10) * ci: Update and rename build.yml to cd.yml * ci: Create test.yml * Delete .github/workflows/test.yml * ci: Create test.yml * Update test.yml --- .github/workflows/{build.yml => cd.yml} | 6 ++-- .github/workflows/test.yml | 40 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) rename .github/workflows/{build.yml => cd.yml} (94%) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/cd.yml similarity index 94% rename from .github/workflows/build.yml rename to .github/workflows/cd.yml index 9afac95..ca2b669 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/cd.yml @@ -1,13 +1,11 @@ -name: Build +name: Build and Deploy on: push: branches: [ "master" ] - pull_request_target: - branches: [ "master" ] permissions: - contents: read + contents: write checks: write jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..53b17db --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: Test + +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +permissions: + contents: write + checks: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Build + uses: gradle/gradle-build-action@v2 + with: + gradle-version: 8.5 + arguments: build + + - name: Test + uses: gradle/gradle-build-action@v2 + with: + gradle-version: 8.5 + arguments: test