diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 3d0b79b..4f6d731 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -4,14 +4,16 @@ 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: typos-action + - name: Check Spell uses: crate-ci/typos@master resolve-modules: @@ -26,18 +28,24 @@ jobs: - id: set-matrix run: ./hack/resolve-modules.sh - lint: - name: lint module + golangci-lint: runs-on: ubuntu-latest - needs: resolve-modules - strategy: - matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }} steps: - - uses: actions/checkout@v3 - - name: Lint - uses: golangci/golangci-lint-action@v3 + - uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + 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@v6 with: version: latest working-directory: ${{ matrix.workdir }} args: -E gofumpt --timeout 10m - skip-pkg-cache: true + skip-pkg-cache: true \ No newline at end of file diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml deleted file mode 100644 index fb6cfcd..0000000 --- a/.github/workflows/release-check.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release Check - -on: - pull_request: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Check Source Branch - run: python2 -c "exit(0 if '${{ github.head_ref }}'.startswith('release') or '${{ github.head_ref }}'.startswith('hotfix') else 1)" - - - name: Check Version - run: | - # get version code, runner not support grep -E here - SOURCE_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'` - git checkout main - MASTER_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'` - git checkout ${{Head.SHA}} - # check version update - python2 -c "exit(0 if list(map(int,'${SOURCE_VERSION#v}'.split('.')[:3])) > list(map(int,'${MASTER_VERSION#v}'.split('.')[:3])) else 1)" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13cb76f..2ed9786 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,12 +48,11 @@ jobs: - '6379:6379' 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.18 + go-version: stable - uses: actions/cache@v3 with: