-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Improve project workflows and implement linting, testing, a…
…nd building actions via GitHub Actions. - Add Github Actions for linting, testing, and building - Upgrade Go version from 1.20 to 1.22 - Improve error handling and logging in various providers - Whitelist relevant files in .gitignore - Delete unnecessary ci.yml file
- Loading branch information
Showing
13 changed files
with
556 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Build on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
go-version: ["1.22.x"] | ||
|
||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Go ${{ matrix.go-version }} | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: false | ||
id: go | ||
|
||
- name: cache go modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Format Check | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
diff -u <(echo -n) <(gofmt -d .) | ||
- name: Get dependencies | ||
run: go mod download | ||
|
||
- name: Build | ||
run: go build -v ./... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22.x" | ||
cache: false | ||
|
||
- name: Check spelling with custom config file | ||
uses: crate-ci/typos@master | ||
with: | ||
config: ./.typos.toml | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: ["1.22.x"] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Run tests | ||
run: go test -v ./... -covermode=count | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.22.x" | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Calc coverage | ||
run: | | ||
go test -v ./... -covermode=count -coverprofile=coverage.out | ||
- name: Convert coverage.out to coverage.lcov | ||
uses: jandelgado/gcov2lcov-action@v1 | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: coverage.lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.