initial build/test steps for nodejs

This commit is contained in:
Wryn (yage) Wagner 2024-02-20 22:08:07 -07:00
parent f20c2b24f0
commit 6ac1015718
2 changed files with 72 additions and 5 deletions

View File

@ -10,6 +10,11 @@ executors:
- image: cimg/python:3.11 - image: cimg/python:3.11
resource_class: small resource_class: small
nodejs:
docker:
- image: node:18
resource_class: small
jobs: jobs:
python-test: python-test:
@ -29,13 +34,76 @@ jobs:
- python/dist - python/dist
- run: pip install twine && twine upload dist/* - run: pip install twine && twine upload dist/*
nodesjs-test:
executor: nodejs
working_directory: ./zx/lib
steps:
- checkout
- restore_cache:
name: restore pnpm cache
keys:
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
- run:
name: pnpm install
command: |
corepack enable
corepack prepare pnpm@latest-8 --activate
pnpm config set store-dir .pnpm-store
pnpm install
- save_cache:
name: save pnpm cache
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
paths:
- .pnpm-store
- run: pnpm test
- run: pnpm lint
nodesjs-publish:
executor: nodejs
working_directory: ./zx/lib
steps:
- checkout
- restore_cache:
name: restore pnpm cache
keys:
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
- run:
name: pnpm install
command: |
corepack enable
corepack prepare pnpm@latest-8 --activate
pnpm config set store-dir .pnpm-store
pnpm install
- save_cache:
name: save pnpm cache
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
paths:
- .pnpm-store
- run: pnpm build
- run: pnpm version $(git describe --tags)
workflows: workflows:
build: build:
jobs: jobs:
- python-test - python-test
- publish: - python-publish:
requires: [test] requires: [python-test]
filters:
branches:
only: main
- nodejs-test
- nodejs-publish:
requires: [nodejs-test]
filters: filters:
branches: branches:
only: main only: main

View File

@ -9,7 +9,7 @@
"scripts": { "scripts": {
"build": "rm -rf ./dist && tsc", "build": "rm -rf ./dist && tsc",
"test": "jest", "test": "jest",
"lint": "eslint .", "lint": "eslint . && prettier --check src/",
"format": "prettier --write src/" "format": "prettier --write src/"
}, },
"author": "Wryn (yage) Wagner", "author": "Wryn (yage) Wagner",
@ -95,6 +95,5 @@
}, },
"dependencies": { "dependencies": {
"execa": "^8.0.1" "execa": "^8.0.1"
}, }
"version": "3.9.1"
} }