forked from air-verse/air
-
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.
Merge branch 'air-verse:master' into master
- Loading branch information
Showing
33 changed files
with
1,812 additions
and
750 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,56 +1,62 @@ | ||
name: build | ||
name: Build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
name: build | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: check out code | ||
uses: actions/checkout@v2 | ||
- name: setup Go 1.21 | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
id: go | ||
uses: actions/setup-go@v2 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ^1.21 | ||
- name: build | ||
go-version: ^1.22 | ||
- name: Install golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.59 | ||
- name: Install dependency | ||
run: if [ $(uname) == "Darwin" ]; then brew install gnu-sed ;fi | ||
- name: Build | ||
run: make build | ||
- name: install dependency | ||
run: if [ $(uname) == "Darwin" ]; then brew install gnu-sed ;fi | ||
- name: run Unit tests. | ||
run: go install github.com/go-delve/delve/cmd/dlv@latest && go test ./... -v -covermode=count -coverprofile=coverage.txt | ||
- name: upload Coverage report to CodeCov | ||
uses: codecov/codecov-action@v2 | ||
- name: Run unit tests | ||
run: go install github.com/go-delve/delve/cmd/dlv@latest && go test ./... -v -covermode=count -coverprofile=coverage.txt | ||
- name: Upload Coverage report to CodeCov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.txt | ||
verbose: true | ||
|
||
push_to_docker_latest: | ||
name: push master code to docker latest image | ||
name: Push master code to docker latest image | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: login to DockerHub | ||
uses: docker/login-action@v1 | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: build and push | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: cosmtrek/air:latest | ||
- name: show image digest | ||
- name: Show image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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,52 +1,54 @@ | ||
name: release | ||
name: Release | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ master ] | ||
branches: [master] | ||
|
||
jobs: | ||
release: | ||
name: release | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
- name: setup Go | ||
uses: actions/setup-go@v2 | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ^1.21 | ||
- name: set GOVERSION | ||
go-version: ^1.22 | ||
|
||
- name: Set GOVERSION | ||
run: echo "GOVERSION=$(go version | sed -r 's/go version go(.*)\ .*/\1/')" >> $GITHUB_ENV | ||
- name: set AirVersion | ||
- name: Set AirVersion | ||
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
- name: show version | ||
- name: Show version | ||
run: echo ${{ env.GOVERSION }} ${{ env.VERSION }} | ||
|
||
- name: run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: login to DockerHub | ||
uses: docker/login-action@v1 | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: push to docker hub | ||
- name: Push to DockerHub | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: cosmtrek/air:${{ env.VERSION }} | ||
- name: show docker image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
- name: Show docker image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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,18 +1,19 @@ | ||
name: smoke_test | ||
name: Smoke test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
smoke_test_ubuntu: | ||
uses: cosmtrek/air/.github/workflows/smoke_test_reuse_job.yml@add_smoke_test | ||
with: | ||
uses: air-verse/air/.github/workflows/smoke_test_reuse_job.yml@master | ||
with: | ||
run_on: ubuntu-latest | ||
smoke_test_macos: | ||
uses: cosmtrek/air/.github/workflows/smoke_test_reuse_job.yml@add_smoke_test | ||
with: | ||
uses: air-verse/air/.github/workflows/smoke_test_reuse_job.yml@master | ||
with: | ||
run_on: macos-latest | ||
smoke_test_windows: | ||
uses: cosmtrek/air/.github/workflows/smoke_test_window_reust_job.yml@fix_window_arg_bug | ||
with: | ||
uses: air-verse/air/.github/workflows/smoke_test_reuse_job_windows.yml@master | ||
with: | ||
run_on: windows-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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
run: | ||
timeout: 2m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. | ||
- gci # Gci controls Go package import order and makes it always deterministic | ||
- goimports # checks that goimports was run | ||
- ineffassign # Detects when assignments to existing variables are not used | ||
- misspell # spell checker | ||
- revive # configurable linter for Go. Drop-in replacement of golint | ||
- staticcheck # go vet on steroids | ||
- stylecheck # static analysis, finds bugs and performance issues, offers simplifications, and enforces style rules | ||
- unconvert # Remove unnecessary type conversions | ||
- unused # Checks Go code for unused constants, variables, functions and types |
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:1.21 AS builder | ||
FROM golang:1.22 AS builder | ||
|
||
MAINTAINER Rick Yu <[email protected]> | ||
LABEL maintainer="Rick Yu <[email protected]>" | ||
|
||
ENV GOPATH /go | ||
ENV GO111MODULE on | ||
|
@@ -12,7 +12,7 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download | |
|
||
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make ci && make install | ||
|
||
FROM golang:1.21 | ||
FROM golang:1.22 | ||
|
||
COPY --from=builder /go/bin/air /go/bin/air | ||
|
||
|
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.