Skip to content

Commit

Permalink
Add Makefile, bump linter version
Browse files Browse the repository at this point in the history
  • Loading branch information
weqqr committed Oct 23, 2024
1 parent 06d3328 commit ae9b86b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: [ master ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -19,12 +18,12 @@ jobs:
go-version: '1.22'

- name: Build
run: go build -v ./...
run: make

- name: Lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
golangci-lint run --fix=false
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
make lint
- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
config.toml
/panorama
/bin
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
FROM docker.io/node:18-alpine AS ui_builder
WORKDIR /app/ui
COPY ui/package*.json ./
RUN npm install
COPY ui .
RUN npm run build

FROM docker.io/golang:1.22-alpine AS backend_builder
WORKDIR /app
RUN apk add git
COPY go.mod go.sum main.go ./
RUN go mod download && go mod verify
COPY --from=ui_builder /app/ui/build /app/ui/build
RUN apk add git make
COPY go.mod go.sum ./
RUN go mod download
COPY Makefile ./
COPY cmd ./cmd
COPY internal ./internal
RUN go build -v
RUN make

FROM scratch
WORKDIR /app
COPY --from=backend_builder /app/panorama ./
COPY --from=backend_builder /app/bin/panorama ./
COPY config.example.toml /etc/panorama/config.toml

ENTRYPOINT ["./panorama", "run", "--config", "/etc/panorama/config.toml"]
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
GOEXE=$(shell go env GOEXE)
PANORAMA_BIN=bin/panorama${GOEXE}

.PHONY: all
all: ${PANORAMA_BIN}

bin/panorama: \
cmd/panorama/* \
internal/**/*
go build -o ${PANORAMA_BIN} ./cmd/panorama

.PHONY: lint
lint:
golangci-lint run --fix=false --color=always

.PHONY: clean
clean:
rm -rf bin
File renamed without changes.
1 change: 1 addition & 0 deletions internal/tile/tiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (t *Tiler) FullRender(game *game.Game, world *world.World, workers int, reg
positions <- render.TilePosition{X: x, Y: y}
}
}

close(positions)

wg.Wait()
Expand Down

0 comments on commit ae9b86b

Please sign in to comment.