From 8361085c3533f8578f6328a88473956a768bf57d Mon Sep 17 00:00:00 2001 From: hitesh22rana Date: Thu, 26 Dec 2024 15:01:41 +0530 Subject: [PATCH] chore: added test and pr merge check workflow --- .github/workflows/{docker.yml => docker.yaml} | 0 .github/workflows/test.yaml | 30 +++++++++++++++++++ 2 files changed, 30 insertions(+) rename .github/workflows/{docker.yml => docker.yaml} (100%) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yaml similarity index 100% rename from .github/workflows/docker.yml rename to .github/workflows/docker.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..e3f351d --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,30 @@ +name: Test and PR Merge Check + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23 + + - name: Run tests + run: go test -v ./... + + - name: Check if PR can be merged + if: github.event_name == 'pull_request' + run: | + if [ $? -ne 0 ]; then + echo "Tests failed, PR cannot be merged!" + exit 1 + fi