-
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.
* fix lint err * Update internal/server/server.go Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> * Update internal/server/server.go Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com> --------- Co-authored-by: qodo-merge-pro[bot] <151058649+qodo-merge-pro[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c237530
commit 6ec18ad
Showing
20 changed files
with
686 additions
and
649 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 |
---|---|---|
@@ -1,79 +1,79 @@ | ||
name: Go | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
tags: [ 'v*' ] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- name: Run Tests | ||
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.txt | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
build: | ||
needs: [test, lint] | ||
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- run: | | ||
go build -v -ldflags " | ||
-X github.com/cloudtesting/internal/version.Version=${GITHUB_SHA::7} | ||
-X github.com/cloudtesting/internal/version.GitCommit=${GITHUB_SHA} | ||
-X github.com/cloudtesting/internal/version.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
-X github.com/cloudtesting/internal/version.BuildUser=${GITHUB_ACTOR} | ||
-X github.com/cloudtesting/internal/version.GoVersion=$(go version | cut -d' ' -f3) | ||
" ./... | ||
goreleaser: | ||
needs: [test, lint] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
name: Go | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
push: | ||
branches: [ main ] | ||
tags: [ 'v*' ] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- name: Run Tests | ||
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.txt | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
|
||
build: | ||
needs: [test, lint] | ||
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- run: | | ||
go build -v -ldflags " | ||
-X github.com/cloudtesting/internal/version.Version=${GITHUB_SHA::7} | ||
-X github.com/cloudtesting/internal/version.GitCommit=${GITHUB_SHA} | ||
-X github.com/cloudtesting/internal/version.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
-X github.com/cloudtesting/internal/version.BuildUser=${GITHUB_ACTOR} | ||
-X github.com/cloudtesting/internal/version.GoVersion=$(go version | cut -d' ' -f3) | ||
" ./... | ||
goreleaser: | ||
needs: [test, lint] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
cache: true | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
LDFLAGS: "-X github.com/cloudtesting/internal/version.BuildUser=${GITHUB_ACTOR} -X github.com/cloudtesting/internal/version.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 | ||
.glide/ | ||
# Binaries for programs and plugins | ||
*.exe | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, build with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 | ||
.glide/ |
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,21 @@ | ||
linters: | ||
enable: | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- typecheck | ||
- unused | ||
|
||
output: | ||
format: colored-line-number | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test\.go | ||
linters: | ||
- errcheck | ||
|
||
run: | ||
deadline: 5m |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ldflags: | ||
- -s -w -X main.version={{.Version}} | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ldflags: | ||
- -s -w -X main.version={{.Version}} | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^ci:' |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
## 2024-12-10 | ||
|
||
### Added | ||
- Introduced a new command-line interface using the Cobra library with root and server commands. | ||
- Implemented GitHub Actions workflow for CI/CD with testing and release automation using GoReleaser. | ||
- Added tests for server command handlers to ensure correct HTTP responses. | ||
|
||
### Changed | ||
- Refactored the main application to utilize the new command structure. | ||
## 2024-12-10 | ||
|
||
### Added | ||
- Introduced a new command-line interface using the Cobra library with root and server commands. | ||
- Implemented GitHub Actions workflow for CI/CD with testing and release automation using GoReleaser. | ||
- Added tests for server command handlers to ensure correct HTTP responses. | ||
|
||
### Changed | ||
- Refactored the main application to utilize the new command structure. | ||
- Updated the README to reflect the new CI/CD process and build instructions. |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM golang:latest | ||
RUN mkdir /app | ||
ADD . /app/ | ||
WORKDIR /app | ||
RUN go build -o main . | ||
FROM golang:latest | ||
RUN mkdir /app | ||
ADD . /app/ | ||
WORKDIR /app | ||
RUN go build -o main . | ||
CMD ["/app/main"] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
Copyright © 2022 Cory M. MacDonald <[email protected]> | ||
Copyright © 2022 Cory M. MacDonald <[email protected]> |
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# cloudtesting ![Build Status](https://github.com/corymacd/cloudtesting/actions/workflows/build.yml/badge.svg) | ||
|
||
Minimal golang http api for testing of deployment pipelines | ||
|
||
## Building and Testing | ||
|
||
This project uses GitHub Actions for CI/CD and GoReleaser for building and releasing. | ||
|
||
### Development Build | ||
bash | ||
go build -v | ||
### Releases | ||
Releases are automated using GoReleaser. To create a new release: | ||
|
||
1. Tag the release: | ||
git tag -a v1.0.0 -m "Release message" | ||
git push origin v1.0.0 | ||
|
||
This will trigger the GitHub Actions workflow which: | ||
- Runs all tests | ||
- Creates cross-platform builds (Linux, Windows, macOS) | ||
- Generates a GitHub release with artifacts | ||
- Creates release notes automatically | ||
|
||
# cloudtesting ![Build Status](https://github.com/corymacd/cloudtesting/actions/workflows/build.yml/badge.svg) | ||
|
||
Minimal golang http api for testing of deployment pipelines | ||
|
||
## Building and Testing | ||
|
||
This project uses GitHub Actions for CI/CD and GoReleaser for building and releasing. | ||
|
||
### Development Build | ||
bash | ||
go build -v | ||
### Releases | ||
Releases are automated using GoReleaser. To create a new release: | ||
|
||
1. Tag the release: | ||
git tag -a v1.0.0 -m "Release message" | ||
git push origin v1.0.0 | ||
|
||
This will trigger the GitHub Actions workflow which: | ||
- Runs all tests | ||
- Creates cross-platform builds (Linux, Windows, macOS) | ||
- Generates a GitHub release with artifacts | ||
- Creates release notes automatically | ||
|
||
Binaries will be available on the GitHub Releases page. |
Oops, something went wrong.