From 113830711bb09b9b8c16728f32a0db532553ef16 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Thu, 11 Jul 2024 15:30:11 +0800 Subject: [PATCH 01/11] chore: remove check_branch_name.sh --- check_branch_name.sh | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100755 check_branch_name.sh diff --git a/check_branch_name.sh b/check_branch_name.sh deleted file mode 100755 index 1876fc0..0000000 --- a/check_branch_name.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -current=$(git status | head -n1 | sed 's/On branch //') -name=${1:-$current} -if [[ ! $name =~ ^(((opt(imize)?|feat(ure)?|(bug|hot)?fix|test|refact(or)?|ci)/.+)|(main|develop)|(release-v[0-9]+\.[0-9]+)|(release/v[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9.]+(\+[a-z0-9.]+)?)?)|revert-[a-z0-9]+)$ ]]; then - echo "branch name '$name' is invalid" - exit 1 -else - echo "branch name '$name' is valid" -fi From 6a9032ee3f06e9d30ea538c0a75907753b3cdbab Mon Sep 17 00:00:00 2001 From: Jiun Lee Date: Wed, 17 Jul 2024 15:03:19 +0800 Subject: [PATCH 02/11] Update .golangci.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```sh run golangci-lint Running [/root/golangci-lint-1.59.1-linux-amd64/golangci-lint run --out-format=github-actions] in [] ... level=warning msg="[config_reader] The configuration option `run.skip-files` is deprecated, please use `issues.exclude-files`." level=warning msg="[config_reader] The configuration option `run.skip-dirs` is deprecated, please use `issues.exclude-dirs`." level=warning msg="[config_reader] The configuration option `output.format` is deprecated, please use `output.formats`" level=warning msg="[lintersdb] The linter \"deadcode\" is deprecated (step 2) and deactivated. It should be removed from the list of disabled linters. https://golangci-lint.run/product/roadmap/#linter-deprecation-cycle" ``` 这些配置已经过时了, 需要改为推荐项 --- .golangci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index ec7a899..d8844c7 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -2,13 +2,10 @@ run: # include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin` skip-dirs-use-default: true - skip-dirs: - skip-files: - - ".*\\.mock\\.go$" # output configuration options output: # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions - format: colored-line-number + formats: colored-line-number # All available settings of specific linters. # Refer to https://golangci-lint.run/usage/linters linters-settings: @@ -34,3 +31,6 @@ linters: - staticcheck issues: exclude-use-default: true + exclude-files: + - ".*\\.mock\\.go$" + exclude-dirs: From 175f28d8bb7b223fe4c463f7010cfc7e2b68c5a4 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Fri, 26 Jul 2024 14:20:12 +0800 Subject: [PATCH 03/11] chore: update workflow to use github by default --- .github/workflows/pr-check.yml | 16 ++++++++-------- .github/workflows/tests.yml | 29 ++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ffa860b..26f4ab5 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -4,9 +4,9 @@ on: [ pull_request ] jobs: compliant: - runs-on: [ self-hosted, X64 ] + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check License Header uses: apache/skywalking-eyes/header@v0.4.0 @@ -17,11 +17,11 @@ jobs: uses: crate-ci/typos@master staticcheck: - runs-on: [ self-hosted, X64 ] + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: "1.22" @@ -45,11 +45,11 @@ jobs: staticcheck_flags: -checks=inherit,-SA1029 lint: - runs-on: [ self-hosted, X64 ] + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: "1.22" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b96ef5..bd6d4d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,21 +4,32 @@ on: [ push, pull_request ] jobs: unit-benchmark-test: - strategy: - matrix: - go: [ "1.18", "1.19", "1.20", "1.21", "1.22" ] - os: [ X64 ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go }} + go-version: "1.22" - name: Unit Test run: go test -race -covermode=atomic -coverprofile=coverage.out ./... - name: Benchmark run: go test -bench=. -benchmem -run=none ./... + + compatibility-test: + strategy: + matrix: + go: [ "1.19", "1.20", "1.21", "1.22" ] + os: [ X64, ARM64 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache: false # don't use cache for self-hosted runners + - name: Unit Test + run: go test -race -covermode=atomic ./... \ No newline at end of file From 68cd5a7de1d3952de2e3c819423ea36e5e25e000 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Thu, 8 Aug 2024 18:59:04 +0800 Subject: [PATCH 04/11] chore: rm release-check, useless for most projects --- .github/workflows/pr-check.yml | 14 +++++++++++--- .github/workflows/release-check.yml | 25 ------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/release-check.yml diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 26f4ab5..265bb01 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -23,7 +23,11 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: stable + # For self-hosted, the cache path is shared across projects + # and it works well without the cache of github actions + # Enable it if we're going to use Github only + # cache: false - uses: actions/cache@v3 with: @@ -51,10 +55,14 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: stable + # for self-hosted, the cache path is shared across projects + # and it works well without the cache of github actions + # Enable it if we're going to use Github only + # cache: false - name: Golangci Lint # https://golangci-lint.run/ - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: latest diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml deleted file mode 100644 index fb6cfcd..0000000 --- a/.github/workflows/release-check.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release Check - -on: - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Check Source Branch - run: python2 -c "exit(0 if '${{ github.head_ref }}'.startswith('release') or '${{ github.head_ref }}'.startswith('hotfix') else 1)" - - - name: Check Version - run: | - # get version code, runner not support grep -E here - SOURCE_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'` - git checkout main - MASTER_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'` - git checkout ${{Head.SHA}} - # check version update - python2 -c "exit(0 if list(map(int,'${SOURCE_VERSION#v}'.split('.')[:3])) > list(map(int,'${MASTER_VERSION#v}'.split('.')[:3])) else 1)" From dc57747aba02957eaf85c767304ecfd247881396 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Thu, 7 Nov 2024 17:26:08 +0800 Subject: [PATCH 05/11] chore: update CI to use ubuntu-latest by default --- .github/workflows/pr-check.yml | 36 ++-------------------------------- .github/workflows/tests.yml | 7 +++---- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 265bb01..e4871eb 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -16,39 +16,7 @@ jobs: - name: Check Spell uses: crate-ci/typos@master - staticcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: stable - # For self-hosted, the cache path is shared across projects - # and it works well without the cache of github actions - # Enable it if we're going to use Github only - # cache: false - - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - reviewdog-${{ runner.os }}-go- - - - uses: reviewdog/action-staticcheck@v1 - with: - github_token: ${{ secrets.github_token }} - # Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review]. - reporter: github-pr-review - # Report all results. - filter_mode: nofilter - # Exit with 1 when it find at least one finding. - fail_on_error: true - # Set staticcheck flags - staticcheck_flags: -checks=inherit,-SA1029 - - lint: + golangci-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -59,7 +27,7 @@ jobs: # for self-hosted, the cache path is shared across projects # and it works well without the cache of github actions # Enable it if we're going to use Github only - # cache: false + cache: true - name: Golangci Lint # https://golangci-lint.run/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd6d4d4..d7f11d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: stable - name: Unit Test run: go test -race -covermode=atomic -coverprofile=coverage.out ./... @@ -22,14 +22,13 @@ jobs: strategy: matrix: go: [ "1.19", "1.20", "1.21", "1.22" ] - os: [ X64, ARM64 ] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} - cache: false # don't use cache for self-hosted runners + cache: true # don't use cache for self-hosted runners - name: Unit Test run: go test -race -covermode=atomic ./... \ No newline at end of file From 923f2ede4bd935282aeaaf0610a6423e132f7f1d Mon Sep 17 00:00:00 2001 From: luoguangming Date: Mon, 31 Mar 2025 16:35:02 +0800 Subject: [PATCH 06/11] chore: update golangci config Change-Id: I394b679ff4413f44bbcc7089c3f9f1877bf9c2c8 --- .github/workflows/pr-check.yml | 10 +++++----- .github/workflows/tests.yml | 4 ++-- .golangci.yaml | 35 +++++++++++++--------------------- _typos.toml | 2 +- 4 files changed, 21 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index e4871eb..15d2dea 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -16,7 +16,7 @@ jobs: - name: Check Spell uses: crate-ci/typos@master - golangci-lint: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -24,12 +24,12 @@ jobs: uses: actions/setup-go@v5 with: go-version: stable - # for self-hosted, the cache path is shared across projects - # and it works well without the cache of github actions - # Enable it if we're going to use Github only + # For self-hosted, the cache path is shared across projects + # And it works well without the cache of GitHub actions + # Enable it if we're going to use GitHub only cache: true - - name: Golangci Lint + - name: GolangCI Lint # https://golangci-lint.run/ uses: golangci/golangci-lint-action@v6 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d7f11d4..7d73813 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,7 +13,7 @@ jobs: go-version: stable - name: Unit Test - run: go test -race -covermode=atomic -coverprofile=coverage.out ./... + run: go test -race -coverprofile=coverage.out -covermode=atomic ./... - name: Benchmark run: go test -bench=. -benchmem -run=none ./... @@ -21,7 +21,7 @@ jobs: compatibility-test: strategy: matrix: - go: [ "1.19", "1.20", "1.21", "1.22" ] + go: [ "1.19", oldstable ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.golangci.yaml b/.golangci.yaml index d8844c7..b4a4281 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,36 +1,27 @@ # Options for analysis running. run: - # include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin` - skip-dirs-use-default: true -# output configuration options -output: - # Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions - formats: colored-line-number -# All available settings of specific linters. + timeout: 3m + # Refer to https://golangci-lint.run/usage/linters linters-settings: gofumpt: # Choose whether to use the extra rules. # Default: false extra-rules: true - govet: - # Disable analyzers by name. - # Run `go tool vet help` to see all analyzers. - disable: - - stdmethods + linters: + disable-all: true enable: - - gofumpt - - goimports - - gofmt - disable: - - errcheck - - typecheck - - deadcode - - varcheck + - gosimple + - govet + - ineffassign - staticcheck + - unused + - unconvert + - goimports + - gofumpt + issues: exclude-use-default: true - exclude-files: - - ".*\\.mock\\.go$" exclude-dirs: + - kitex_gen \ No newline at end of file diff --git a/_typos.toml b/_typos.toml index 47b5bea..dfd475b 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,4 +1,4 @@ # Typo check: https://github.com/crate-ci/typos [files] -extend-exclude = ["go.mod", "go.sum", "check_branch_name.sh"] +extend-exclude = ["go.mod", "go.sum"] From c2c2a5d2b9d8ce983821b9de7bcc21f89a39de38 Mon Sep 17 00:00:00 2001 From: luoguangming Date: Fri, 27 Jun 2025 14:13:32 +0800 Subject: [PATCH 07/11] chore: update pr-check template for security Change-Id: Ic99cc4a2bd6aec38cb6746ab56cb1fe3c15dc8ec --- .github/workflows/pr-check.yml | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 15d2dea..a14e477 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,9 +1,33 @@ name: Pull Request Check -on: [ pull_request ] +on: + pull_request_target: + types: + - opened + - synchronize + - labeled + - reopened jobs: - compliant: + check-user-trust: + runs-on: ubuntu-latest + outputs: + is-trusted: ${{ steps.check.outputs.is_trusted }} + steps: + - name: Check if PR sender is trusted + id: check + run: | + ASSOC="${{ github.event.sender.author_association }}" + echo "Sender association: $ASSOC" + if [[ "$ASSOC" == "OWNER" || "$ASSOC" == "MEMBER" || "$ASSOC" == "COLLABORATOR" ]]; then + echo "trusted=true" >> $GITHUB_OUTPUT + else + echo "trusted=false" >> $GITHUB_OUTPUT + fi + + compliant-check: + needs: check-user-trust + if: needs.check-user-trust.outputs.is_trusted == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -16,7 +40,9 @@ jobs: - name: Check Spell uses: crate-ci/typos@master - lint: + golangci-lint: + needs: check-user-trust + if: needs.check-user-trust.outputs.is_trusted == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -34,3 +60,4 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: latest + only-new-issues: true From 1d94c0c245dc9cf6e5102c64905ea1743a73cb48 Mon Sep 17 00:00:00 2001 From: luoguangming Date: Fri, 27 Jun 2025 14:31:20 +0800 Subject: [PATCH 08/11] sperate push and pull ci Change-Id: Icdb5be7c1571b56ac0d189ed5c08d4689a9d7026 --- .github/workflows/pr-check.yml | 38 ++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index a14e477..be9a50a 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -8,6 +8,10 @@ on: - labeled - reopened +permissions: + contents: read + pull-requests: write + jobs: check-user-trust: runs-on: ubuntu-latest @@ -61,3 +65,37 @@ jobs: with: version: latest only-new-issues: true + + unit-benchmark-test: + needs: check-user-trust + if: needs.check-user-trust.outputs.is_trusted == 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Unit Test + run: go test -race -coverprofile=coverage.out -covermode=atomic ./... + + - name: Benchmark + run: go test -bench=. -benchmem -run=none ./... + + compatibility-test: + needs: check-user-trust + if: needs.check-user-trust.outputs.is_trusted == 'true' + strategy: + matrix: + go: [ "1.19", oldstable ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + cache: true # don't use cache for self-hosted runners + - name: Unit Test + run: go test -race -covermode=atomic ./... \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7d73813..9dd76a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ -name: Tests +name: Push Check -on: [ push, pull_request ] +on: push jobs: unit-benchmark-test: From 1a76c95df367dc9168c056842a9321db89705f79 Mon Sep 17 00:00:00 2001 From: luoguangming Date: Fri, 27 Jun 2025 15:37:02 +0800 Subject: [PATCH 09/11] chore: update ci permission Change-Id: If6589424100a446a5813be11d0cdff69cbe5b677 --- .github/workflows/pr-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index be9a50a..bc89fe7 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -10,7 +10,7 @@ on: permissions: contents: read - pull-requests: write + pull-requests: none jobs: check-user-trust: @@ -48,6 +48,8 @@ jobs: needs: check-user-trust if: needs.check-user-trust.outputs.is_trusted == 'true' runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - uses: actions/checkout@v4 - name: Set up Go From be5da7ab07cdf7a1118dcec8925a195624d5d835 Mon Sep 17 00:00:00 2001 From: luoguangming Date: Fri, 27 Jun 2025 15:39:12 +0800 Subject: [PATCH 10/11] chore: permission default read Change-Id: I4c4681483e706be68f4d1aa264a1225f3697ff31 --- .github/workflows/pr-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index bc89fe7..672ae0f 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -10,7 +10,7 @@ on: permissions: contents: read - pull-requests: none + pull-requests: read jobs: check-user-trust: From c342664255adede50397e08c44d8d831a9f5c8f6 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Mon, 30 Jun 2025 20:49:44 +0800 Subject: [PATCH 11/11] Merge pull request #20 from cloudwego/revert-19-fix/ci Revert "chore: update pr-check template for security" --- .github/workflows/pr-check.yml | 73 ++-------------------------------- .github/workflows/tests.yml | 4 +- 2 files changed, 5 insertions(+), 72 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 672ae0f..15d2dea 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -1,37 +1,9 @@ name: Pull Request Check -on: - pull_request_target: - types: - - opened - - synchronize - - labeled - - reopened - -permissions: - contents: read - pull-requests: read +on: [ pull_request ] jobs: - check-user-trust: - runs-on: ubuntu-latest - outputs: - is-trusted: ${{ steps.check.outputs.is_trusted }} - steps: - - name: Check if PR sender is trusted - id: check - run: | - ASSOC="${{ github.event.sender.author_association }}" - echo "Sender association: $ASSOC" - if [[ "$ASSOC" == "OWNER" || "$ASSOC" == "MEMBER" || "$ASSOC" == "COLLABORATOR" ]]; then - echo "trusted=true" >> $GITHUB_OUTPUT - else - echo "trusted=false" >> $GITHUB_OUTPUT - fi - - compliant-check: - needs: check-user-trust - if: needs.check-user-trust.outputs.is_trusted == 'true' + compliant: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -44,12 +16,8 @@ jobs: - name: Check Spell uses: crate-ci/typos@master - golangci-lint: - needs: check-user-trust - if: needs.check-user-trust.outputs.is_trusted == 'true' + lint: runs-on: ubuntu-latest - permissions: - pull-requests: write steps: - uses: actions/checkout@v4 - name: Set up Go @@ -66,38 +34,3 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: latest - only-new-issues: true - - unit-benchmark-test: - needs: check-user-trust - if: needs.check-user-trust.outputs.is_trusted == 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: stable - - - name: Unit Test - run: go test -race -coverprofile=coverage.out -covermode=atomic ./... - - - name: Benchmark - run: go test -bench=. -benchmem -run=none ./... - - compatibility-test: - needs: check-user-trust - if: needs.check-user-trust.outputs.is_trusted == 'true' - strategy: - matrix: - go: [ "1.19", oldstable ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - cache: true # don't use cache for self-hosted runners - - name: Unit Test - run: go test -race -covermode=atomic ./... \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9dd76a8..7d73813 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,6 @@ -name: Push Check +name: Tests -on: push +on: [ push, pull_request ] jobs: unit-benchmark-test: