diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 2845b05a5..c2ac66273 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -33,6 +33,10 @@ jobs: display_name: Windows - os: ubuntu-latest display_name: Linux + - os: ubuntu-latest + display_name: JS + goos: js + goarch: wasm name: ${{ matrix.display_name }} runs-on: ${{ matrix.os }} timeout-minutes: 15 @@ -40,7 +44,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Check for duplicate constants - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && matrix.goos != 'js' run: | ! awk '/const \(/,/)/{print $0}' management/server/activity/codes.go | grep -o '= [0-9]*' | sort | uniq -d | grep . - name: Install Go @@ -49,10 +53,13 @@ jobs: go-version: "1.23.x" cache: false - name: Install dependencies - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-latest' && matrix.goos != 'js' run: sudo apt update && sudo apt install -y -q libgtk-3-dev libayatana-appindicator3-dev libgl1-mesa-dev xorg-dev libpcap-dev - name: golangci-lint uses: golangci/golangci-lint-action@v4 with: version: latest args: --timeout=12m --out-format colored-line-number + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} diff --git a/.github/workflows/wasm-build-validation.yml b/.github/workflows/wasm-build-validation.yml new file mode 100644 index 000000000..6ec2c6da1 --- /dev/null +++ b/.github/workflows/wasm-build-validation.yml @@ -0,0 +1,32 @@ +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_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: "1.23.x" + - 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 +