diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 16f214ef0..a9c318f53 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -11,18 +11,21 @@ jobs: - name: Check License Header uses: apache/skywalking-eyes/header@v0.4.0 - - name: typos-action + - name: Check Spell uses: crate-ci/typos@master staticcheck: 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.21 + 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: reviewdog/action-staticcheck@v1 with: @@ -35,3 +38,19 @@ jobs: fail_on_error: true # Set staticcheck flags staticcheck_flags: -checks=inherit,-SA1029,-SA5008 + + lint: + runs-on: [ self-hosted, X64 ] + steps: + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + 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@v6 + with: + version: latest \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1098aa013..7c97b982e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,39 +6,33 @@ jobs: compat-test: strategy: matrix: - version: ["1.17", "1.18"] + version: ["1.17", "1.18", "1.19"] 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: ${{ matrix.version }} + cache: false # don't use cache for self-hosted runners # Just build tests without running them - name: Build Test run: go test -run=nope ./... - lint-and-ut: + unit-test: strategy: matrix: - version: ["1.19", "1.20", "1.21", "1.22"] + version: ["1.20", "1.21", "1.22"] 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: ${{ matrix.version }} + cache: false # don't use cache for self-hosted runners - - name: Golangci Lint - # https://golangci-lint.run/ - uses: golangci/golangci-lint-action@v3 - with: - version: latest - skip-cache: true - name: Unit Test run: go test -race -covermode=atomic -coverprofile=coverage.txt ./... @@ -48,31 +42,28 @@ jobs: ut-windows: strategy: matrix: - version: ["1.19", "1.20", "1.21", "1.22"] + version: ["1.20", "1.21", "1.22"] runs-on: windows-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.version }} + cache: false # don't use cache for self-hosted runners - name: Unit Test run: go test -race -covermode=atomic ./... hz-test-unix: - strategy: - matrix: - version: [ '1.21' ] 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: ${{ matrix.version }} + go-version: stable + cache: false # don't use cache for self-hosted runners - name: Setup Environment run: | @@ -91,17 +82,13 @@ jobs: hz-test-windows: - strategy: - matrix: - version: [ '1.21'] runs-on: windows-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.version }} + go-version: stable - name: Get changed files id: changed-files diff --git a/.github/workflows/vulncheck.yml b/.github/workflows/vulncheck.yml index 9b88498b9..6cbeff848 100644 --- a/.github/workflows/vulncheck.yml +++ b/.github/workflows/vulncheck.yml @@ -22,9 +22,9 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: "stable" + go-version: stable check-latest: true cache: false