Skip to content

ci: update and pin actions (#295) #554

ci: update and pin actions (#295)

ci: update and pin actions (#295) #554

Workflow file for this run

# 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