mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
Edited Spark
This commit is contained in:
@@ -2,10 +2,10 @@ version: 2.1
|
|||||||
|
|
||||||
orbs:
|
orbs:
|
||||||
node: circleci/node@5.2.0
|
node: circleci/node@5.2.0
|
||||||
docker: circleci/docker@2.6.0
|
node-executor:
|
||||||
slack: circleci/slack@4.13.3
|
- image: cimg/node:20.11
|
||||||
|
|
||||||
executors:
|
playwrig
|
||||||
node-executor:
|
node-executor:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:20.11
|
- image: cimg/node:20.11
|
||||||
@@ -18,11 +18,11 @@ executors:
|
|||||||
resource_class: large
|
resource_class: large
|
||||||
working_directory: ~/repo
|
working_directory: ~/repo
|
||||||
|
|
||||||
commands:
|
descr
|
||||||
restore-dependencies:
|
restore-dependencies:
|
||||||
description: 'Restore npm dependencies from cache'
|
description: 'Restore npm dependencies from cache'
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
save-dependencies:
|
||||||
keys:
|
keys:
|
||||||
- v1-dependencies-{{ checksum "package-lock.json" }}
|
- v1-dependencies-{{ checksum "package-lock.json" }}
|
||||||
- v1-dependencies-
|
- v1-dependencies-
|
||||||
@@ -31,99 +31,99 @@ commands:
|
|||||||
description: 'Install npm dependencies'
|
description: 'Install npm dependencies'
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Install dependencies
|
- run:
|
||||||
command: npm install --legacy-peer-deps
|
command: npm run lint || echo "No lint
|
||||||
|
|
||||||
save-dependencies:
|
- notify-slack
|
||||||
description: 'Save npm dependencies to cache'
|
test:
|
||||||
steps:
|
steps:
|
||||||
- save_cache:
|
- restore-dep
|
||||||
paths:
|
- save-dep
|
||||||
- node_modules
|
name: Run unit t
|
||||||
key: v1-dependencies-{{ checksum "package-lock.json" }}
|
- store_test_results:
|
||||||
|
|
||||||
notify-slack-on-fail:
|
destination:
|
||||||
description: 'Notify Slack on failure'
|
|
||||||
steps:
|
|
||||||
- slack/notify:
|
|
||||||
event: fail
|
|
||||||
template: basic_fail_1
|
|
||||||
|
|
||||||
notify-slack-on-success:
|
execut
|
||||||
description: 'Notify Slack on success'
|
|
||||||
steps:
|
|
||||||
- slack/notify:
|
|
||||||
event: pass
|
|
||||||
template: success_tagged_deploy_1
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
executor: node-executor
|
|
||||||
steps:
|
|
||||||
- checkout
|
- checkout
|
||||||
- restore-dependencies
|
- install-depen
|
||||||
|
- run:
|
||||||
|
|
||||||
|
root: .
|
||||||
|
- dist
|
||||||
|
|
||||||
|
- notify-slack-
|
||||||
|
e2e-test:
|
||||||
|
steps:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
name: Install Pla
|
||||||
|
- ru
|
||||||
|
comman
|
||||||
|
path: playwright-r
|
||||||
|
path: playwright-r
|
||||||
|
- store_artifacts:
|
||||||
|
de
|
||||||
|
|
||||||
|
executor: node-executor
|
||||||
|
- chec
|
||||||
- install-dependencies
|
- install-dependencies
|
||||||
- save-dependencies
|
|
||||||
- run:
|
- run:
|
||||||
name: Run ESLint
|
command: npm audit
|
||||||
command: npm run lint || echo "No lint script found"
|
|
||||||
- run:
|
|
||||||
name: TypeScript type check
|
|
||||||
command: npx tsc --noEmit
|
|
||||||
- notify-slack-on-fail
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
executor: node-executor
|
sudo apt-get up
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
comman
|
||||||
- restore-dependencies
|
path: trivy-report
|
||||||
- install-dependencies
|
- notify-slack-on-fail
|
||||||
- save-dependencies
|
docker-build-and-push:
|
||||||
- run:
|
steps:
|
||||||
name: Run unit tests
|
- setup_remote_docker:
|
||||||
command: npm test || echo "No test script found"
|
- attach_workspace:
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: ./junit.xml
|
command: |
|
||||||
- store_artifacts:
|
|
||||||
path: coverage
|
|
||||||
destination: coverage
|
|
||||||
- notify-slack-on-fail
|
|
||||||
|
|
||||||
build:
|
|
||||||
executor: node-executor
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore-dependencies
|
|
||||||
- install-dependencies
|
|
||||||
- save-dependencies
|
|
||||||
- run:
|
- run:
|
||||||
name: Build application
|
command: |
|
||||||
command: npm run build
|
docker buildx inspe
|
||||||
- persist_to_workspace:
|
name: Build multi-
|
||||||
|
|
||||||
|
|
||||||
|
--tag ghcr.io
|
||||||
|
|
||||||
|
- checkout
|
||||||
|
--tag ghcr.i
|
||||||
|
.
|
||||||
|
- notify-slack-on-f
|
||||||
|
- run:
|
||||||
|
steps:
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
root: .
|
root: .
|
||||||
paths:
|
-H
|
||||||
- dist
|
- dist
|
||||||
- store_artifacts:
|
|
||||||
path: dist
|
executor: node-e
|
||||||
destination: build
|
- checkout
|
||||||
- notify-slack-on-fail
|
name: Deploy to pr
|
||||||
|
|
||||||
e2e-test:
|
e2e-test:
|
||||||
executor: playwright-executor
|
-d "{\"image\":\"gh
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
workflows:
|
||||||
- restore-dependencies
|
build-test-deploy:
|
||||||
- install-dependencies
|
- lint
|
||||||
- save-dependencies
|
requires:
|
||||||
- attach_workspace:
|
- build:
|
||||||
at: .
|
- t
|
||||||
- run:
|
re
|
||||||
name: Install Playwright browsers
|
- security-scan:
|
||||||
command: npx playwright install --with-deps chromium
|
- build
|
||||||
- run:
|
re
|
||||||
name: Run E2E tests
|
- test
|
||||||
command: npm run test:e2e
|
filters:
|
||||||
- store_test_results:
|
only:
|
||||||
path: playwright-report
|
path: playwright-report
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: playwright-report
|
path: playwright-report
|
||||||
@@ -230,10 +230,10 @@ workflows:
|
|||||||
jobs:
|
jobs:
|
||||||
- lint
|
- lint
|
||||||
- test:
|
- test:
|
||||||
requires:
|
|
||||||
- lint
|
- lint
|
||||||
- build:
|
- build:
|
||||||
requires:
|
|
||||||
- test
|
- test
|
||||||
- e2e-test:
|
- e2e-test:
|
||||||
requires:
|
requires:
|
||||||
@@ -253,21 +253,21 @@ workflows:
|
|||||||
- develop
|
- develop
|
||||||
- deploy-staging:
|
- deploy-staging:
|
||||||
requires:
|
requires:
|
||||||
- docker-build-and-push
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: develop
|
|
||||||
- hold-for-approval:
|
|
||||||
type: approval
|
|
||||||
requires:
|
|
||||||
- docker-build-and-push
|
|
||||||
- e2e-test
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: main
|
|
||||||
- deploy-production:
|
|
||||||
requires:
|
|
||||||
- hold-for-approval
|
|
||||||
filters:
|
|
||||||
branches:
|
|
||||||
only: main
|
|
||||||
|
|||||||
Reference in New Issue
Block a user