73 lines
1.7 KiB
YAML
73 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
branches: ["**"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build-test-wasm:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.23.x'
|
|
|
|
- name: Install extra tools
|
|
run: |
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Go env
|
|
run: go env
|
|
|
|
- name: CI checks (lint, tests, coverage, etc.)
|
|
run: make ci
|
|
|
|
- name: Build WebAssembly module
|
|
run: make wasm-build
|
|
|
|
- name: Prepare npm package folder
|
|
run: make npm-pack
|
|
|
|
- name: Create npm tarball
|
|
id: npm_pack
|
|
run: |
|
|
echo "tarball=$(npm pack ./npm/poindexter-wasm)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Upload dist (WASM artifacts)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: poindexter-wasm-dist
|
|
if-no-files-found: error
|
|
path: |
|
|
dist/poindexter.wasm
|
|
dist/wasm_exec.js
|
|
|
|
- name: Upload npm package folder
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: npm-poindexter-wasm
|
|
if-no-files-found: error
|
|
path: npm/poindexter-wasm/**
|
|
|
|
- name: Upload npm tarball
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: npm-poindexter-wasm-tarball
|
|
if-no-files-found: error
|
|
path: ${{ steps.npm_pack.outputs.tarball }}
|