From b6d1adb2680cfd522bfcef215a70355d847332c7 Mon Sep 17 00:00:00 2001 From: Kyle Xiao Date: Sun, 28 Jul 2024 01:18:14 +0800 Subject: [PATCH] ci: fix not running ./tests --- .github/workflows/pr-check.yml | 26 ++++++++++------------- .github/workflows/tests.yml | 38 ++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index c72216c..8d7e33c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -19,18 +19,12 @@ jobs: staticcheck: runs-on: [ self-hosted, X64 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.22" - - - uses: actions/cache@v3 + uses: actions/setup-go@v5 with: - path: ~/go/pkg/mod - key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - reviewdog-${{ runner.os }}-go- + go-version: stable + cache: false # don't use cache for self-hosted runners - uses: reviewdog/action-staticcheck@v1 with: @@ -39,23 +33,25 @@ jobs: reporter: github-pr-review # Report all results. filter_mode: nofilter - # Exit with 1 when it find at least one finding. + # Exit with 1 when it finds at least one finding. fail_on_error: true # Set staticcheck flags + # -ST1006 for fixing jit code receiver names like `self` staticcheck_flags: -checks=inherit,-SA1029, -ST1006 lint: runs-on: [ self-hosted, X64 ] 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" + go-version: stable + cache: false # don't use cache for self-hosted runners - name: Golangci Lint # https://golangci-lint.run/ - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: version: latest only-new-issues: true diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0571b93..c1403da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,22 +3,42 @@ name: Tests on: [ push, pull_request ] jobs: - unit-benchmark-test: + compatibility-test-amd64: strategy: matrix: go: [ "1.17", "1.18", "1.19", "1.20", "1.21", "1.22" ] os: [ X64 ] runs-on: ${{ matrix.os }} 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 }} + cache: false # don't use cache for self-hosted runners + - name: Test ./... + run: go test -race ./... + - name: Test ./tests + run: cd tests && go test -race ./... + - name: Test Benchmark + run: go test -bench=. -benchmem -run=none ./... -benchtime=100ms - - name: Unit Test - run: go test -race -covermode=atomic -coverprofile=coverage.out ./... - - - name: Benchmark - run: go test -bench=. -benchmem -run=none ./... + compatibility-test-arm64: + strategy: + matrix: + go: [ "1.17", "1.18", "1.19", "1.20", "1.21", "1.22" ] + os: [ 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: Test ./... + run: go test -race ./internal/reflect + - name: Test ./tests + run: cd tests && go test -race ./... + - name: Test Benchmark + run: go test -bench=. -benchmem -run=none ./internal/reflect -benchtime=100ms