Add Forgejo CI workflow
Verify job compiles and tests the Go side with a stubbed dist/, which main.go embeds and the frontend build produces. Binary job builds the UI and the real binary. Living in .forgejo/workflows means Forgejo uses this instead of the 23 upstream .github workflows, which need GitHub-only runner labels.
This commit is contained in:
parent
13215c74c2
commit
19348d3a37
1 changed files with 73 additions and 0 deletions
73
.forgejo/workflows/build.yml
Normal file
73
.forgejo/workflows/build.yml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
name: Build
|
||||
|
||||
# Forgejo bevorzugt .forgejo/workflows gegenüber .github/workflows. Die 23
|
||||
# Upstream-Workflows laufen hier also nicht mit — die verlangen ohnehin
|
||||
# GitHub-spezifische Runner-Label (depot-ubuntu-24.04-arm) und Secrets.
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
name: Go build & test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
# main.go bindet dist/ per //go:embed ein. Das Verzeichnis wird vom
|
||||
# Frontend-Build erzeugt und ist gitignored — für den reinen Compile-Check
|
||||
# reicht ein Platzhalter, go:embed braucht nur mindestens eine Datei.
|
||||
- name: Stub embedded assets
|
||||
run: mkdir -p dist && echo stub > dist/index.html
|
||||
|
||||
- name: Build
|
||||
run: go build ./...
|
||||
|
||||
- name: Vet
|
||||
run: go vet ./util/sponsor/... ./charger/... ./core/... ./server/...
|
||||
|
||||
- name: Test
|
||||
run: CGO_ENABLED=0 go test ./...
|
||||
|
||||
binary:
|
||||
name: evcc binary
|
||||
runs-on: ubuntu-latest
|
||||
needs: verify
|
||||
|
||||
steps:
|
||||
# fetch-depth 0: das Makefile leitet VERSION aus git describe --tags ab
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 26
|
||||
cache: npm
|
||||
|
||||
- name: Install UI deps
|
||||
run: npm ci
|
||||
|
||||
- name: Build UI
|
||||
run: make ui
|
||||
|
||||
- name: Build binary
|
||||
run: make build
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: evcc
|
||||
path: evcc
|
||||
Loading…
Add table
Add a link
Reference in a new issue