From ef50399d2b873a9bc74ea14393497a5a995c56b4 Mon Sep 17 00:00:00 2001 From: Kavinraja-G Date: Sun, 10 Sep 2023 21:02:46 +0530 Subject: [PATCH] Add PR workflow --- .github/workflows/pr.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/release.yml | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..e27b13b --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,29 @@ +name: pr + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v1 + with: + go-version: 1.20 + + - name: Go Build + run: go build -v ./... + + - name: Go Test + run: go test -v ./... \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 43811e1..a914106 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,10 +13,12 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + - name: Set up Go uses: actions/setup-go@v1 with: go-version: 1.20 + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -24,5 +26,6 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create PR in krew-index uses: rajatjindal/krew-release-bot@v0.0.25 \ No newline at end of file