Skip to content

Commit 06066f1

Browse files
Upgrade format like fuctions (#1112)
* have format function signatures * use string as basis for fmt alternate type * update page with format * remove FormatString function * Update build.yml * fix errors and logs * Update build.yml * Update build.yml * Update build.yml * Create release.yml
1 parent cfb5645 commit 06066f1

13 files changed

Lines changed: 15284 additions & 5136 deletions

File tree

.github/workflows/build.yml

Lines changed: 62 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,87 @@
11
name: Build
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
415

516
jobs:
617
code:
718
name: Code Check
819
runs-on: ubuntu-latest
20+
timeout-minutes: 10
21+
922
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v6
25+
with:
26+
persist-credentials: false
27+
1028
- name: Setup Go
11-
uses: actions/setup-go@v3
29+
uses: actions/setup-go@v6
1230
with:
13-
go-version: "1.25"
14-
- name: Checkout Code
15-
uses: actions/checkout@v3
31+
go-version-file: go.mod
32+
cache: true
33+
cache-dependency-path: go.sum
34+
1635
- name: Vet
17-
run: |
18-
go vet ./...
36+
run: go vet ./...
1937

2038
server:
2139
name: Unit Tests
2240
runs-on: ubuntu-latest
41+
timeout-minutes: 15
42+
2343
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v6
46+
with:
47+
persist-credentials: false
48+
2449
- name: Setup Go
25-
uses: actions/setup-go@v3
50+
uses: actions/setup-go@v6
2651
with:
27-
go-version: "1.25"
28-
- name: Checkout Code
29-
uses: actions/checkout@v3
30-
- name: Run Unit Tests
31-
run: |
32-
go test -race ./...
52+
go-version-file: go.mod
53+
cache: true
54+
cache-dependency-path: go.sum
55+
56+
- name: Run unit tests
57+
run: go test -race ./...
3358

3459
client:
3560
name: WebAssembly Unit Tests
36-
runs-on: ubuntu-22.04
61+
runs-on: ubuntu-latest
62+
timeout-minutes: 15
63+
env:
64+
GOOS: js
65+
GOARCH: wasm
66+
3767
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v6
70+
with:
71+
persist-credentials: false
72+
3873
- name: Setup Go
39-
uses: actions/setup-go@v3
74+
uses: actions/setup-go@v6
4075
with:
41-
go-version: "1.25"
42-
- name: Checkout Code
43-
uses: actions/checkout@v3
44-
- name: Install WASM Browser Test
45-
run: |
46-
go install github.com/agnivade/wasmbrowsertest@latest
47-
mv `go env GOPATH`/bin/wasmbrowsertest `go env GOPATH`/bin/go_js_wasm_exec
48-
- name: Run Unit Tests
76+
go-version-file: go.mod
77+
cache: true
78+
cache-dependency-path: go.sum
79+
80+
- name: Show Go version
81+
run: go version
82+
83+
- name: Run WebAssembly unit tests
4984
run: |
50-
GOARCH=wasm GOOS=js go test ./pkg/app
51-
GOARCH=wasm GOOS=js go test ./pkg/errors
52-
GOARCH=wasm GOOS=js go test ./pkg/logs
85+
WASM_EXEC="$(go env GOROOT)/lib/wasm/go_js_wasm_exec"
86+
go test -exec "${WASM_EXEC}" ./pkg/errors
87+
go test -exec "${WASM_EXEC}" ./pkg/logs

.github/workflows/release.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Release
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- Build
7+
types:
8+
- completed
9+
branches:
10+
- master
11+
12+
permissions:
13+
contents: write
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
17+
cancel-in-progress: false
18+
19+
env:
20+
BASE_VERSION: v11.0.0
21+
22+
jobs:
23+
release:
24+
name: Publish Release
25+
if: >
26+
github.event.workflow_run.conclusion == 'success' &&
27+
github.event.workflow_run.event == 'push' &&
28+
github.event.workflow_run.head_branch == 'master'
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 20
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v6
35+
with:
36+
ref: ${{ github.event.workflow_run.head_sha }}
37+
fetch-depth: 0
38+
39+
- name: Setup Go
40+
uses: actions/setup-go@v6
41+
with:
42+
go-version-file: go.mod
43+
cache: true
44+
cache-dependency-path: go.sum
45+
46+
- name: Install release build tools
47+
run: go install golang.org/x/tools/cmd/godoc@latest
48+
49+
- name: Build GitHub Pages assets
50+
run: make github
51+
52+
- name: Compute Version
53+
id: version
54+
shell: bash
55+
run: |
56+
set -euo pipefail
57+
git fetch --tags origin
58+
59+
LAST_TAG="$(git tag -l "${BASE_VERSION%.*}.*" --sort=-v:refname | head -n1 || true)"
60+
if [[ -z "$LAST_TAG" ]]; then
61+
NEXT_TAG="${BASE_VERSION}"
62+
else
63+
IFS='.' read -r MAJOR MINOR PATCH <<<"${LAST_TAG#v}"
64+
PATCH=$((PATCH+1))
65+
NEXT_TAG="v${MAJOR}.${MINOR}.${PATCH}"
66+
fi
67+
68+
if git ls-remote --tags origin "refs/tags/${NEXT_TAG}" | grep -q .; then
69+
echo "Tag ${NEXT_TAG} already exists on remote. Exiting to avoid mismatch."
70+
exit 1
71+
fi
72+
73+
echo "next=${NEXT_TAG}" >> "$GITHUB_OUTPUT"
74+
echo "sha_tag=sha-${{ github.event.workflow_run.head_sha }}" >> "$GITHUB_OUTPUT"
75+
echo "VERSION=${NEXT_TAG}" >> "$GITHUB_ENV"
76+
77+
- name: Create and push tag
78+
env:
79+
TAG: ${{ steps.version.outputs.next }}
80+
run: |
81+
git config user.name "github-actions[bot]"
82+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
83+
git tag "${TAG}" "${{ github.event.workflow_run.head_sha }}"
84+
git push origin "refs/tags/${TAG}"
85+
86+
- name: Create GitHub release
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
TAG: ${{ steps.version.outputs.next }}
90+
run: |
91+
gh release create "${TAG}" \
92+
--verify-tag \
93+
--latest \
94+
--generate-notes \
95+
--title "${TAG}"

docs/web/app.wasm

318 KB
Binary file not shown.

0 commit comments

Comments
 (0)