forked from Daniel.Sy/loic-go
Compare commits
1 commit
#3-cloudif
...
main
Author | SHA1 | Date | |
---|---|---|---|
3f6abd393c |
2 changed files with 57 additions and 12 deletions
57
.forgejo/workflows/build.yml
Normal file
57
.forgejo/workflows/build.yml
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- 'dependabot/**' #avoid duplicates: only run the PR, not the push
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
GO_VERSION: '1.24.1'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: go get .
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: go build -o loic
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test
|
||||||
|
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Linting
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
|
with:
|
||||||
|
go-version: ${{ env.GO_VERSION }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: go get .
|
||||||
|
|
||||||
|
- name: Formatting
|
||||||
|
run: test -z $(gofmt -l .)
|
||||||
|
|
||||||
|
- name: golangci-lint
|
||||||
|
uses: https://github.com/golangci/golangci-lint-action@v7
|
||||||
|
with:
|
||||||
|
version: v2.0
|
12
Dockerfile
12
Dockerfile
|
@ -1,12 +0,0 @@
|
||||||
FROM golang:1.24 AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o loic .
|
|
||||||
RUN ls -l /app/loic
|
|
||||||
|
|
||||||
FROM alpine:latest
|
|
||||||
WORKDIR /app/
|
|
||||||
COPY --from=builder /app/loic .
|
|
||||||
COPY pkg/web/templates/ pkg/web/templates/
|
|
||||||
ENTRYPOINT [ "./loic" ]
|
|
||||||
CMD [ "web" ]
|
|
Loading…
Reference in a new issue