Files
landwelle/.github/workflows/ci.yml
T
OpenGenesis (MPL 2.0) 2ed47e77b5 feat: migrate Landwelle server builds and deployment to Linux x64 v1.5.75
* feat(x64): add Linux amd64 builds, deploy scripts and regression tests

* docs(x64): update release, operations and architecture references

* docs(x64): add migration, cutover and rollback runbook

* ci(x64): verify Docker runtime and protect container build context
2026-11-07 15:23:52 +01:00

137 lines
3.9 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
docker run --rm --entrypoint /usr/local/bin/landwelle-portal landwelle-portal:x64-ci --version | grep -qx 'Landwelle v1.5.75'
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