Skip to content

Commit

Permalink
Merge pull request #545 from openinfradev/release
Browse files Browse the repository at this point in the history
241015 main from release ( v3.2.1 )
  • Loading branch information
ktkfree authored Oct 15, 2024
2 parents 37987e0 + 10ad5bf commit b4925d5
Show file tree
Hide file tree
Showing 199 changed files with 72,663 additions and 15,785 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ env:
TAG: ${{github.sha}}

jobs:
build-and-push-image:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
Expand Down
38 changes: 15 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,19 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
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: v1.51.0
args: --timeout=5m
# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
go-version: "1.21"
cache: false
- name: Install golangci-lint
# Install golangci-lint from source instead of using
# golangci-lint-action to ensure the golangci-lint binary is built with
# the same Go version we're targeting.
# Avoids incompatibility issues such as:
# - https://github.com/golangci/golangci-lint/issues/2922
# - https://github.com/golangci/golangci-lint/issues/2673
# - https://github.com/golangci/golangci-lint-action/issues/442
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Run golangci-lint
run: golangci-lint run --verbose --out-format=github-actions
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ web
main
output
vendor
go.work
go.work.sum
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Build - backend
FROM --platform=linux/amd64 docker.io/library/golang:1.18-buster AS backend-build
FROM --platform=linux/amd64 docker.io/library/golang:1.21 AS backend-build
RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata
RUN wget https://github.com/swaggo/swag/releases/download/v1.7.1/swag_linux_amd64.tar.gz -O - | tar -xz -C /tmp && cp /tmp/swag_linux_amd64/swag /usr/local/bin
RUN wget https://github.com/swaggo/swag/releases/download/v1.16.3/swag_1.16.3_Linux_amd64.tar.gz -O - | tar -xz -C /tmp && cp /tmp/swag /usr/local/bin

WORKDIR /app/backend
COPY ./ .

RUN go mod tidy
RUN swag init -g ./cmd/server/main.go --parseDependency --parseInternal -o ./api/swagger
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./bin/server ./cmd/server/main.go

ENV TZ=Asia/Seoul
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.PHONY: docs
docs:
swag init -g ./cmd/server/main.go -o ./api/swagger
swag init -g ./cmd/server/main.go --parseDependency --parseInternal -o ./api/swagger
swag fmt

.PHONY: build
build:
Expand All @@ -17,6 +18,7 @@ test:

.PHONY: dev_run
dev_run:
swag init -g ./cmd/server/main.go -o ./api/swagger
swag init -g ./cmd/server/main.go --parseDependency --parseInternal -o ./api/swagger
swag fmt
go build ./cmd/server/main.go
./main
Loading

0 comments on commit b4925d5

Please sign in to comment.