From 519129a2aec7c08fd49db77e676b7aa34702c9e8 Mon Sep 17 00:00:00 2001 From: SoapiestWaffles <68536094+soapiestwaffles@users.noreply.github.com> Date: Wed, 15 May 2024 21:50:24 -0700 Subject: [PATCH] add a seperate lint and test action for PRs --- .github/workflows/lint-pr.yml | 37 +++++++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 8 -------- 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..dc6e88b --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,37 @@ +name: "Lint & Test PR" +on: + pull_request: + branches: + - master + - main + types: + - opened + - synchronize + - reopened + - ready_for_review +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci-lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: latest + golangci-test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: set up golang + uses: actions/setup-go@v2 + with: + go-version: 1.22 + - name: golangci-test + run: go test ./... -coverprofile=profile.cov -cover diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 99dd8f9..4cbba2f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,14 +7,6 @@ on: - master - main pull_request: - branches: - - master - - main - types: - - opened - - synchronize - - reopened - - ready_for_review permissions: contents: read # Optional: allow read access to pull request. Use with `only-new-issues` option.