diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 81a5c35..bb0dc9c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -4,57 +4,33 @@ 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@501a28d2fb4a9b962661987e50cf0219631b32ff + uses: apache/skywalking-eyes/header@v0.4.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Check Spell uses: crate-ci/typos@master - staticcheck: - runs-on: [ self-hosted, X64 ] + golangci-lint: + 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.19 - - - 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: - runs-on: [ self-hosted, X64 ] - steps: - - uses: actions/checkout@v3 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.19 + 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: true - name: Golangci Lint # https://golangci-lint.run/ - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: latest + version: latest \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fff2553..d7f11d4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,29 +4,31 @@ on: [ push, pull_request ] jobs: unit-benchmark-test: - strategy: - matrix: - go: [ 1.18, 1.19 ] - os: [ X64, ARM64 ] - 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 }} - - # block scenario, comment temporarily -# - uses: actions/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ runner.os }}-go- + go-version: stable - 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" ] + 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