mirror of
https://github.com/netbirdio/netbird.git
synced 2026-03-31 06:34:14 -04:00
Upgrade Go toolchain and golang.org/x/* deps to 1.24.10, standardize GitHub Actions to derive Go version from go.mod and adjust checkout ordering, raise WASM size limit to 55 MB, update FreeBSD tarball and gomobile refs, fix a few format-string/logging calls, treat usernames ending with $ as system accounts, and add Windows tests.
68 lines
1.9 KiB
YAML
68 lines
1.9 KiB
YAML
name: Wasm
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.actor_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
js_lint:
|
|
name: "JS / Lint"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Install dependencies
|
|
run: sudo apt update && sudo apt install -y -q libgtk-3-dev libayatana-appindicator3-dev libgl1-mesa-dev xorg-dev libpcap-dev
|
|
- name: Install golangci-lint
|
|
uses: golangci/golangci-lint-action@d6238b002a20823d52840fda27e2d4891c5952dc
|
|
with:
|
|
version: latest
|
|
install-mode: binary
|
|
skip-cache: true
|
|
skip-pkg-cache: true
|
|
skip-build-cache: true
|
|
- name: Run golangci-lint for WASM
|
|
run: |
|
|
GOOS=js GOARCH=wasm golangci-lint run --timeout=12m --out-format colored-line-number ./client/...
|
|
continue-on-error: true
|
|
|
|
js_build:
|
|
name: "JS / Build"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Install Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: "go.mod"
|
|
- name: Build Wasm client
|
|
run: GOOS=js GOARCH=wasm go build -o netbird.wasm ./client/wasm/cmd
|
|
env:
|
|
CGO_ENABLED: 0
|
|
- name: Check Wasm build size
|
|
run: |
|
|
echo "Wasm build size:"
|
|
ls -lh netbird.wasm
|
|
|
|
SIZE=$(stat -c%s netbird.wasm)
|
|
SIZE_MB=$((SIZE / 1024 / 1024))
|
|
|
|
echo "Size: ${SIZE} bytes (${SIZE_MB} MB)"
|
|
|
|
if [ ${SIZE} -gt 57671680 ]; then
|
|
echo "Wasm binary size (${SIZE_MB}MB) exceeds 55MB limit!"
|
|
exit 1
|
|
fi
|
|
|