Files
landwelle/.github/workflows/ci.yml
T
OpenGenesis (MPL 2.0) fda6501439 fix: exclude legacy Niedersachsen Hub events in Landwelle v1.5.76
* fix(events): exclude legacy tourism hub sources in events.go

* fix(events): exclude legacy tourism hub sources in admin_management.go

* test(events): prevent reintroduction of legacy tourism hub entries

* chore: bump Landwelle to v1.5.76

* chore: bump Landwelle to v1.5.76

* docs(events): clarify v1.5.76 external-event hardening and server checks

* docs(events): clarify v1.5.76 external-event hardening and server checks

* docs(events): clarify v1.5.76 external-event hardening and server checks

* docs: release notes for Landwelle v1.5.76

* fix(events): escape ILIKE percent signs inside fmt.Sprintf SQL

* test(events): normalize escaped SQL wildcards in fmt.Sprintf queries

* ci: compare container version to source instead of hardcoding 1.5.75
2026-11-10 17:07:27 +01:00

139 lines
4.1 KiB
YAML

name: Landwelle CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: landwelle-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Go tests and vet
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
cache: true
- name: Verify modules
run: go mod verify
- name: Test
run: go test ./...
- name: Vet
run: go vet ./...
build-amd64:
name: Linux x64 production build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24.4'
cache: true
- name: Build portal
env:
CGO_ENABLED: '0'
GOOS: linux
GOARCH: amd64
run: go build -trimpath -o /tmp/landwelle-portal-linux-amd64 .
- name: Build migrator
env:
CGO_ENABLED: '0'
GOOS: linux
GOARCH: amd64
run: go build -trimpath -o /tmp/landwelle-migrate-linux-amd64 ./cmd/migrate
- name: Build adminpass
env:
CGO_ENABLED: '0'
GOOS: linux
GOARCH: amd64
run: go build -trimpath -o /tmp/landwelle-adminpass-linux-amd64 ./cmd/adminpass
- name: Verify x64 ELF binaries
run: |
for name in portal migrate adminpass; do
path="/tmp/landwelle-${name}-linux-amd64"
file "$path" | grep -q 'ELF 64-bit.*x86-64'
go version -m "$path" | grep -q 'GOARCH=amd64'
done
- name: Build from production x64 scripts
run: |
./scripts/build-x64.sh
./scripts/build-migrator-x64.sh
file dist/landwelle-portal-linux-amd64 | grep -q 'x86-64'
./dist/landwelle-portal-linux-amd64 --version | grep -q 'Landwelle v'
container-amd64:
name: Linux x64 container build and smoke test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build x64 container
run: docker build --platform linux/amd64 -t landwelle-portal:x64-ci .
- name: Verify x64 container binary
run: |
docker image inspect landwelle-portal:x64-ci --format '{{.Architecture}}' | grep -qx amd64
expected_version="$(sed -nE 's/^[[:space:]]*applicationVersion[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' main.go | head -n1)"
test -n "$expected_version"
docker run --rm --entrypoint /usr/local/bin/landwelle-portal landwelle-portal:x64-ci --version | grep -Fx "Landwelle v$expected_version"
frontend-static:
name: JavaScript and deployment-script checks
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate JavaScript syntax
run: |
find web/assets -name '*.js' -print0 | while IFS= read -r -d '' file; do
node --check "$file"
done
- name: Validate x64 script execute permissions
run: |
for file in scripts/build-x64.sh scripts/build-migrator-x64.sh scripts/update-portal-on-x64.sh scripts/update-migrations-on-x64.sh scripts/setup-admin-on-x64.sh; do
test -x "$file"
done
- name: Validate shell scripts
run: |
find scripts -name '*.sh' -print0 | while IFS= read -r -d '' file; do
bash -n "$file"
done
- name: Refuse unexpected local Go files
run: |
trap 'rm -f destination_one_ci_sentinel.go' EXIT
printf 'package main\n' > destination_one_ci_sentinel.go
if ./scripts/build-x64.sh > /tmp/landwelle-build-guard.log 2>&1; then
echo "Build unexpectedly accepted an untracked Go source" >&2
exit 1
fi
grep -q destination_one_ci_sentinel.go /tmp/landwelle-build-guard.log