mirror of
https://github.com//cppla/ServerStatus
synced 2026-08-06 13:03:57 +08:00
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: server/go.mod
|
|
cache-dependency-path: server/go.sum
|
|
|
|
- name: Test Go server
|
|
working-directory: server
|
|
run: |
|
|
test -z "$(gofmt -l .)"
|
|
go vet ./...
|
|
go test -race ./...
|
|
CGO_ENABLED=0 go build -trimpath -o /tmp/serverstatus .
|
|
|
|
- name: Check clients, plugins, WebUI and shell scripts
|
|
run: |
|
|
python3 -m py_compile clients/client-linux.py clients/client-psutil.py plugin/bot-telegram.py
|
|
sh -n clients/entrypoint.sh
|
|
bash -n status.sh
|
|
node --check web/js/app.js
|
|
|
|
- name: Validate compose files
|
|
run: |
|
|
docker compose -f docker-compose-server.yml config
|
|
docker compose -f docker-compose-client.yml config
|
|
TG_CHAT_ID=test TG_BOT_TOKEN=test ADMIN_TOKEN=test docker compose -f plugin/docker-compose-telegram.yml config
|
|
|
|
- name: Build Docker images
|
|
run: |
|
|
docker build -f Dockerfile.server -t serverstatus-server:test .
|
|
docker build -f Dockerfile.client -t serverstatus-client:test .
|