-
Notifications
You must be signed in to change notification settings - Fork 41
72 lines (60 loc) · 2.02 KB
/
node.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) 2024 Hemi Labs, Inc.
# Use of this source code is governed by the MIT License,
# which can be found in the LICENSE file.
# GitHub Actions workflow to lint, build and test NPM packages.
name: "Node"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
workflow_call:
concurrency:
group: "node-${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: "${{ github.event_name == 'pull_request' }}"
env:
GO_VERSION: "1.23.x"
PNPM_VERSION: "9.4.x"
jobs:
build:
name: "Build"
runs-on: "ubuntu-latest"
permissions:
contents: read
steps:
- name: "Checkout repository"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Setup Go ${{ env.GO_VERSION }}"
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: "${{ env.GO_VERSION }}"
cache: true
check-latest: true
- name: "Setup pnpm ${{ env.PNPM_VERSION }}"
uses: pnpm/action-setup@0c17529a66aca453f9227af23103ed11469b1e47 # v4.0.0
with:
version: "${{ env.PNPM_VERSION }}"
- name: "Setup Node"
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: "web/.nvmrc"
check-latest: true
cache: "pnpm"
cache-dependency-path: "web/**/pnpm-lock.yaml"
- name: "Install dependencies"
working-directory: "web/"
run: pnpm install --frozen-lockfile
- name: "Install Go dependencies"
working-directory: "web/"
run: make deps
# TODO(joshuasing): Install and use binaryen
- name: "Build @hemilabs/pop-miner WebAssembly binary"
working-directory: "web/"
run: make wasm
- name: "Build @hemilabs/pop-miner package"
working-directory: "web/"
run: pnpm build:pop-miner
- name: "Lint"
working-directory: "web/"
run: pnpm lint