From 175f28d8bb7b223fe4c463f7010cfc7e2b68c5a4 Mon Sep 17 00:00:00 2001 From: Guangming Luo Date: Fri, 26 Jul 2024 14:20:12 +0800 Subject: [PATCH] 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