mirror of
https://gitee.com/dromara/MaxKey.git
synced 2025-12-06 08:59:10 +08:00
CircleCI Commit
This commit is contained in:
parent
45c1aa150d
commit
743f3a44c1
82
.circleci/config.yml
Normal file
82
.circleci/config.yml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
# This config was automatically generated from your source code
|
||||||
|
# Stacks detected: deps:java:.,deps:node:maxkey-web-frontend/maxkey-web-app,tool:gradle:
|
||||||
|
version: 2.1
|
||||||
|
orbs:
|
||||||
|
node: circleci/node@5
|
||||||
|
jobs:
|
||||||
|
test-node:
|
||||||
|
# Install node dependencies and run tests
|
||||||
|
executor: node/default
|
||||||
|
working_directory: ~/project/maxkey-web-frontend/maxkey-web-app
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/project
|
||||||
|
- node/install-packages:
|
||||||
|
pkg-manager: npm
|
||||||
|
- run:
|
||||||
|
name: Run tests
|
||||||
|
command: npm test --passWithNoTests
|
||||||
|
build-node:
|
||||||
|
# Build node project
|
||||||
|
executor: node/default
|
||||||
|
working_directory: ~/project/maxkey-web-frontend/maxkey-web-app
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/project
|
||||||
|
- node/install-packages:
|
||||||
|
pkg-manager: npm
|
||||||
|
- run:
|
||||||
|
command: npm run build
|
||||||
|
- run:
|
||||||
|
name: Create the ~/artifacts directory if it doesn't exist
|
||||||
|
command: mkdir -p ~/artifacts
|
||||||
|
# Copy output to artifacts dir
|
||||||
|
- run:
|
||||||
|
name: Copy artifacts
|
||||||
|
command: cp -R build dist public .output .next .docusaurus ~/artifacts 2>/dev/null || true
|
||||||
|
- store_artifacts:
|
||||||
|
path: ~/artifacts
|
||||||
|
destination: node-build
|
||||||
|
test-java:
|
||||||
|
docker:
|
||||||
|
- image: cimg/openjdk:17.0
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Calculate cache key
|
||||||
|
command: |-
|
||||||
|
find . -name 'pom.xml' -o -name 'gradlew*' -o -name '*.gradle*' | \
|
||||||
|
sort | xargs cat > /tmp/CIRCLECI_CACHE_KEY
|
||||||
|
- restore_cache:
|
||||||
|
key: cache-{{ checksum "/tmp/CIRCLECI_CACHE_KEY" }}
|
||||||
|
- run:
|
||||||
|
command: ./gradlew check
|
||||||
|
- store_test_results:
|
||||||
|
path: build/test-results
|
||||||
|
- save_cache:
|
||||||
|
key: cache-{{ checksum "/tmp/CIRCLECI_CACHE_KEY" }}
|
||||||
|
paths:
|
||||||
|
- ~/.gradle/caches
|
||||||
|
- store_artifacts:
|
||||||
|
path: build/reports
|
||||||
|
deploy:
|
||||||
|
# This is an example deploy job, not actually used by the workflow
|
||||||
|
docker:
|
||||||
|
- image: cimg/base:stable
|
||||||
|
steps:
|
||||||
|
# Replace this with steps to deploy to users
|
||||||
|
- run:
|
||||||
|
name: deploy
|
||||||
|
command: '#e.g. ./deploy.sh'
|
||||||
|
workflows:
|
||||||
|
build-and-test:
|
||||||
|
jobs:
|
||||||
|
- test-node
|
||||||
|
- build-node:
|
||||||
|
requires:
|
||||||
|
- test-node
|
||||||
|
- test-java
|
||||||
|
- test-java
|
||||||
|
# - deploy:
|
||||||
|
# requires:
|
||||||
|
# - build-node
|
||||||
Loading…
x
Reference in New Issue
Block a user