Skip to content

Commit

Permalink
ci: improve github action testing (#60)
Browse files Browse the repository at this point in the history
* ci: improve github action testing

* chore: change license year

* ci: modify the pr-title-checker condition

* ci: Use shell command to check license header

* chore: change PHONY name in Makefile

* chore: add hawkeye config

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* fix: license checker failed

* refactor: rename LICENSE to license-header.txt

* refactor: apply suggestion
  • Loading branch information
daviderli614 authored Feb 13, 2025
1 parent 34c6c23 commit 66d7c5b
Show file tree
Hide file tree
Showing 40 changed files with 527 additions and 444 deletions.
2 changes: 1 addition & 1 deletion codecov.yml → .codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## cat codecov.yml | curl --data-binary @- https://codecov.io/validate
## cat .codecov.yaml | curl --data-binary @- https://codecov.io/validate
coverage:
status:
project:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI

on:
pull_request:
Expand All @@ -20,10 +20,10 @@ jobs:
go-version: ["1.19.x", "1.20.x", "1.21.x"]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
Expand All @@ -35,6 +35,6 @@ jobs:
run: go test -v ./... -race -covermode=atomic -coverprofile=coverage.out

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/license.yml → .github/workflows/license.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: License checker
name: License Header Check

on:
pull_request:
Expand All @@ -14,6 +14,10 @@ jobs:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check License Header
uses: apache/skywalking-eyes/header@main
uses: korandoru/hawkeye@v6
11 changes: 6 additions & 5 deletions .github/workflows/lint.yml → .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: golangci-lint
name: Golang Lint

on:
pull_request:
Expand All @@ -18,14 +18,15 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
- name: Checkout Repository
uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: '1.20.x'

- uses: actions/checkout@v3

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/pr-title-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@ name: Check PR Title

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled
types: [opened, synchronize, reopened, ready_for_review]

jobs:
check-pr-title:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: thehanimo/[email protected].1
- uses: thehanimo/[email protected].3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
Expand Down
31 changes: 0 additions & 31 deletions .licenserc.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Greptime Team
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Tool Versions
KAWKEYE_VERSION ?= v6.0.0

.PHONY: install-hawkeye
install-hawkeye: ## Install hawkeye.
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/korandoru/hawkeye/releases/download/${KAWKEYE_VERSION}/hawkeye-installer.sh | sh

.PHONY: check-lincense-header
check-lincense-header: install-hawkeye ## Check License Header.
hawkeye check --config licenserc.toml

.PHONY: format-lincense-header
format-lincense-header: install-hawkeye ## Format License Header.
hawkeye format --config licenserc.toml

.PHONY: remove-lincense-header
remove-lincense-header: install-hawkeye ## Remove License Header.
hawkeye remove --config licenserc.toml
28 changes: 15 additions & 13 deletions client.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2023 Greptime Team
*
* Licensed 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.
*/

package greptime

Expand Down
28 changes: 15 additions & 13 deletions client_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2023 Greptime Team
*
* Licensed 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.
*/

package greptime

Expand Down
28 changes: 15 additions & 13 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2023 Greptime Team
*
* Licensed 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.
*/

package greptime

Expand Down
28 changes: 15 additions & 13 deletions context/context.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2024 Greptime Team
*
* Licensed 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.
*/

package context

Expand Down
28 changes: 15 additions & 13 deletions errs/error.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2024 Greptime Team
*
* Licensed 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.
*/

package errs

Expand Down
28 changes: 15 additions & 13 deletions examples/healthcheck/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2024 Greptime Team
*
* Licensed 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.
*/

package main

Expand Down
28 changes: 15 additions & 13 deletions examples/hints/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
// Copyright 2024 Greptime Team
//
// Licensed 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.
/*
* Copyright 2024 Greptime Team
*
* Licensed 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.
*/

package main

Expand Down
Loading

0 comments on commit 66d7c5b

Please sign in to comment.