scwrypts/.circleci/config.yml

120 lines
2.4 KiB
YAML
Raw Normal View History

---
version: 2.1
orbs:
python: circleci/python@2.1.1
executors:
python:
docker:
- image: cimg/python:3.11
resource_class: small
2024-02-21 05:08:07 +00:00
nodejs:
docker:
- image: node:18
2024-02-21 05:28:46 +00:00
resource_class: medium
2024-02-21 05:08:07 +00:00
jobs:
python-test:
executor: python
2024-02-21 05:20:27 +00:00
working_directory: ~/scwrypts/py/lib
steps:
2024-02-21 05:16:40 +00:00
- checkout:
2024-02-21 05:20:27 +00:00
path: ~/scwrypts
2024-02-21 05:28:46 +00:00
- run:
name: pytest
command: |
: \
&& pip install . .[test] \
&& pytest \
;
python-publish:
executor: python
2024-02-21 05:20:27 +00:00
working_directory: ~/scwrypts/py/lib
steps:
2024-02-21 05:16:40 +00:00
- checkout:
2024-02-21 05:20:27 +00:00
path: ~/scwrypts
- python/dist
- run: pip install twine && twine upload dist/*
2024-02-21 05:10:32 +00:00
nodejs-test:
2024-02-21 05:08:07 +00:00
executor: nodejs
2024-02-21 05:20:27 +00:00
working_directory: ~/scwrypts/zx/lib
2024-02-21 05:08:07 +00:00
steps:
2024-02-21 05:16:40 +00:00
- checkout:
2024-02-21 05:20:27 +00:00
path: ~/scwrypts
2024-02-21 05:08:07 +00:00
- 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
2024-02-21 05:10:32 +00:00
nodejs-publish:
2024-02-21 05:08:07 +00:00
executor: nodejs
2024-02-21 05:20:27 +00:00
working_directory: ~/scwrypts/zx/lib
2024-02-21 05:08:07 +00:00
steps:
2024-02-21 05:16:40 +00:00
- checkout:
2024-02-21 05:20:27 +00:00
path: ~/scwrypts
2024-02-21 05:08:07 +00:00
- 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:
2024-02-21 05:09:59 +00:00
python:
jobs:
- python-test
2024-02-21 05:08:07 +00:00
- python-publish:
requires: [python-test]
filters:
branches:
only: main
2024-02-21 05:09:59 +00:00
nodejs:
jobs:
2024-02-21 05:08:07 +00:00
- nodejs-test
- nodejs-publish:
requires: [nodejs-test]
filters:
branches:
only: main