mirror of
https://github.com/netbirdio/netbird.git
synced 2026-03-31 06:34:19 -04:00
69 lines
1.8 KiB
YAML
69 lines
1.8 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
|
|
env:
|
|
GOOS: js
|
|
GOARCH: wasm
|
|
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@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
|
|
with:
|
|
version: latest
|
|
install-mode: binary
|
|
skip-cache: true
|
|
skip-save-cache: true
|
|
cache-invalidation-interval: 0
|
|
working-directory: ./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 58720256 ]; then
|
|
echo "Wasm binary size (${SIZE_MB}MB) exceeds 56MB limit!"
|
|
exit 1
|
|
fi
|
|
|