Skip to content

fix: impport formatter #11

fix: impport formatter

fix: impport formatter #11

Workflow file for this run

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
name: CI
on:
push:
pull_request:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
license-check-and-import-format:
name: License Check and Import Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Cache imports-formatter
id: cache-go-bin
uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-imports-formatter-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-imports-formatter-
- name: Download imports-formatter if not cached
if: steps.cache-go-bin.outputs.cache-hit != 'true'
run: |
go install github.com/dubbogo/tools/cmd/imports-formatter@latest
- name: Check License Header
uses: apache/skywalking-eyes/header@main # NOSONAR
- name: Check Golang fmt
run: |
gofmt -s -w .
git diff --exit-code
- name: Check Import Formatting
run: |
imports-formatter
git diff --exit-code
golangci:
needs: license-check-and-import-format
name: Golang Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v8 # NOSONAR
with:
version: v2.4.0
args: --disable errcheck