Skip to content

docs(ui): clarify JsVar proposals and hidden Go fields #1173

docs(ui): clarify JsVar proposals and hidden Go fields

docs(ui): clarify JsVar proposals and hidden Go fields #1173

Workflow file for this run

name: build
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
coverage: ${{ steps.coverage.outputs.coverage }}
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: stable
- name: Generate
run: go generate ./...
- name: Go vet
run: go vet ./...
- name: Check gofmt
run: |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
echo "The following files are not gofmt-formatted:"
echo "$unformatted"
exit 1
fi
- name: Staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@1285a6a5ec1e0ebb658f49e82b6c566a878cc3cb # v0.8.1
staticcheck ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
# Partial cache invalidation can corrupt Staticcheck package facts.
skip-cache: true
- name: Run Gosec Security Scanner
run: |
go install github.com/securego/gosec/v2/cmd/gosec@deb54465fea23d19a77f037e11e6589021f8501d # v2.29.0
gosec ./...
- name: Test
env:
# Fail rather than skip the node-driven JS behavior tests; the runner
# has node installed, so a missing node here is a CI misconfiguration.
JAWS_REQUIRE_NODE: "1"
run: go test -race -coverprofile=coverage.out ./...
- name: Test (production build)
env:
JAWS_REQUIRE_NODE: "1"
# -race selects the debug tag renderer via the "race" build tag, so this
# non-race leg is what exercises the crash-safe release renderer and the
# default TagString forwarding used in production.
run: go test ./...
- name: Calculate code coverage
id: coverage
run: |
echo "coverage=$(go tool cover -func=coverage.out | tail -n 1 | tr -s '\t' | cut -f 3)" >> "$GITHUB_OUTPUT"
go tool cover -html=coverage.out -o=coveragereport.html.out
- name: Upload code coverage
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage
path: coveragereport.html.out
retention-days: 1
- name: Build
run: go build -v ./...
build-386:
# 32-bit leg: on GOARCH=386 int/uint are 32-bit, so this exercises the
# word-size-dependent numeric bounds that the amd64 leg cannot reach.
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: stable
- name: Test numeric packages (386)
env:
GOARCH: "386"
# The race detector is unavailable on 386; disable cgo so the pure-Go
# test binary is statically linked and runs under 32-bit emulation.
CGO_ENABLED: "0"
run: go test ./lib/bind/... ./lib/ui/...
coverage:
needs: build
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Download code coverage
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: coverage
- name: Publish code coverage badge (and optional report)
uses: linkdata/gitcoverage@03383ad3a6ff45e117a50d29d21c3a95c2d5d12a # v11
with:
coverage: ${{ needs.build.outputs.coverage }}
report: "coveragereport.html.out"
token: ${{ github.token }}