Skip to content

Commit

Permalink
ci: fix not running ./tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaost committed Jul 29, 2024
1 parent 2659f3f commit fa7d61b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 27 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [ pull_request ]

jobs:
compliant:
runs-on: [ self-hosted, X64 ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Expand All @@ -17,20 +17,13 @@ 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
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

- uses: reviewdog/action-staticcheck@v1
with:
Expand All @@ -39,23 +32,24 @@ 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 ]
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"
go-version: stable

- 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
38 changes: 29 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fa7d61b

Please sign in to comment.