From e145b98f678213b5d0c01a92fff9b57e5c80358d Mon Sep 17 00:00:00 2001 From: Doctor Vince Date: Mon, 11 Nov 2024 18:50:42 -0500 Subject: [PATCH] change the PR config --- .github/workflows/ci.yaml | 41 ----------------------------- .github/workflows/push-pr-lint.yaml | 37 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/push-pr-lint.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index 637c879d..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: For each commit and PR -on: - push: - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - env: - CGO_ENABLED: 1 - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version-file: go.mod - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - args: -v --config .golangci.yml --timeout=5m - version: latest - - name: make all-checks - run: make all-checks - test: - runs-on: ubuntu-latest - env: - CGO_ENABLED: 1 - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - name: Install Go - uses: actions/setup-go@v3 - with: - go-version-file: go.mod - - name: make all-tests - run: make all-tests - - name: upload codecov - run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/push-pr-lint.yaml b/.github/workflows/push-pr-lint.yaml new file mode 100644 index 00000000..6d6cc92d --- /dev/null +++ b/.github/workflows/push-pr-lint.yaml @@ -0,0 +1,37 @@ +name: lint and test +on: [pull_request, push] + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + args: --config .golangci.yml --timeout 2m + version: v1.61.0 + + - name: Test + run: go test ./... + with: + args: -tags testtools + + build: + runs-on: ubuntu-latest + needs: [lint-test] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod