This repository has been archived by the owner on Feb 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
168 additions
and
7 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,39 @@ | ||
name: go-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
# renovate: datasource=go depName=github.com/golangci/golangci-lint | ||
GOLANGCI_LINT_VERSION: v1.52.2 | ||
|
||
jobs: | ||
lint: | ||
name: Go Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: .go-version | ||
check-latest: true | ||
cache: true | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: ${{ env.GOLANGCI_LINT_VERSION }} | ||
args: --timeout 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: go-release | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: .go-version | ||
# More assembly might be required: Docker logins, GPG, etc. It all depends | ||
# on your needs. | ||
- uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro': | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' | ||
# distribution: | ||
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} |
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 @@ | ||
name: go-test | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: .go-version | ||
check-latest: true | ||
|
||
- name: Test | ||
run: go test -v ./... |
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,38 @@ | ||
run: | ||
deadline: 7m | ||
timeout: 5m | ||
go: '1.20' | ||
|
||
linters: | ||
enable: | ||
- depguard | ||
- godot | ||
- gofumpt | ||
- goimports | ||
- revive | ||
- whitespace | ||
|
||
issues: | ||
exclude-rules: | ||
- path: _test.go | ||
linters: | ||
- errcheck | ||
|
||
linters-settings: | ||
depguard: | ||
list-type: blacklist | ||
include-go-root: true | ||
packages-with-error-message: [] | ||
errcheck: | ||
goimports: | ||
local-prefixes: github.com/stealthrocket/wzprof | ||
gofumpt: | ||
extra-rules: true | ||
misspell: | ||
locale: US | ||
revive: | ||
rules: | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return | ||
- name: unexported-return | ||
severity: warning | ||
disabled: true |
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,26 @@ | ||
FROM golang:1.20-alpine as build | ||
|
||
RUN apk update && apk add make git gcc libc-dev curl | ||
|
||
WORKDIR /go/src/github.com/stealthrocket/timecraft | ||
COPY . . | ||
|
||
ARG version | ||
ARG tags | ||
ARG gocache | ||
|
||
RUN go build -o timecraft | ||
|
||
# The last layer of the build, which determines what the final docker image | ||
# will contain. | ||
FROM alpine | ||
|
||
RUN apk update && apk add ca-certificates curl bind-tools tree | ||
|
||
ENV TIMECRAFT_BIND=:8080 | ||
|
||
EXPOSE 8080/tcp | ||
|
||
COPY --from=build /go/src/github.com/stealthrocket/timecraft/timecraft /usr/bin/timecraft | ||
|
||
ENTRYPOINT ["timecraft"] |
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
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
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