Skip to content

Commit

Permalink
feat: add .nvrmc and improve workflows (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 authored Apr 12, 2024
1 parent a0f3e8c commit b105537
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
name: RUN ES LINT ANS TESTS
name: Build, Lint and Test
on: push
jobs:
build:
strategy:
matrix:
version: ['lts/*']
timeout-minutes: 10
timeout-minutes: 7
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
node-version: 'lts/*'

- name: Cache node modules
id: cache-npm
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install modules
key: cache-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm ci

- name: Run Prettier
Expand All @@ -40,7 +29,7 @@ jobs:
- name: Run ESLint
run: npm run lint:check

- name: Run Build
- name: Build
run: npm run build

- name: Download regular circuits for CI 'latest.zip' from S3
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: Publish package to NPM

on:
workflow_dispatch:
release:
types: [created]

jobs:
publish-npm:
strategy:
matrix:
version: ['lts/*']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm publish
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1

0 comments on commit b105537

Please sign in to comment.