mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-07-12 02:12:59 +08:00
test
This commit is contained in:
parent
5e78060d64
commit
80ca97e682
@ -18,12 +18,18 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
- test:
|
- load-frontend:
|
||||||
requires:
|
requires:
|
||||||
- build-frontend
|
- build-frontend
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
only: /.*/
|
only: /.*/
|
||||||
|
- test:
|
||||||
|
requires:
|
||||||
|
- load-frontend
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /.*/
|
||||||
- build:
|
- build:
|
||||||
requires:
|
requires:
|
||||||
- test
|
- test
|
||||||
@ -66,7 +72,7 @@ workflows:
|
|||||||
docker-password: DOCKERHUB_PASSWORD
|
docker-password: DOCKERHUB_PASSWORD
|
||||||
- docker/publish:
|
- docker/publish:
|
||||||
<<: *docker-push
|
<<: *docker-push
|
||||||
name: "Docker debug version"
|
name: "docker/publish-debug"
|
||||||
filters:
|
filters:
|
||||||
tags:
|
tags:
|
||||||
ignore: /.*/
|
ignore: /.*/
|
||||||
@ -78,6 +84,27 @@ jobs:
|
|||||||
- image: cimg/node:16.13.0
|
- image: cimg/node:16.13.0
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Get hash of frontend code
|
||||||
|
command: |
|
||||||
|
find ./admin-frontend/src -type f -exec md5sum {} + | LC_ALL=C sort > fontend.hash
|
||||||
|
md5sum ./admin-frontend/yarn.lock >> frontend.hash
|
||||||
|
cat frontend.hash
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: .
|
||||||
|
paths:
|
||||||
|
- "frontend.hash"
|
||||||
|
- restore_cache:
|
||||||
|
key: frontend_build_res-{{ checksum "frontend.hash" }}
|
||||||
|
- run:
|
||||||
|
name: Check cache
|
||||||
|
command: |
|
||||||
|
if [ -f ./src/plugins/nonebot_bison/admin_page/dist/index.html ]; then
|
||||||
|
echo "frontend cache exists"
|
||||||
|
circleci-agent step halt
|
||||||
|
else
|
||||||
|
echo "no such cache, build will begin"
|
||||||
|
fi
|
||||||
- node/install-packages:
|
- node/install-packages:
|
||||||
app-dir: ./admin-frontend
|
app-dir: ./admin-frontend
|
||||||
pkg-manager: yarn
|
pkg-manager: yarn
|
||||||
@ -85,10 +112,20 @@ jobs:
|
|||||||
name: yarn build
|
name: yarn build
|
||||||
working_directory: ./admin-frontend
|
working_directory: ./admin-frontend
|
||||||
command: yarn build
|
command: yarn build
|
||||||
|
- save_cache:
|
||||||
|
paths:
|
||||||
|
- ./src/plugins/nonebot_bison/admin_page/dist/
|
||||||
|
key: frontend_build_res-{{ checksum "frontend.hash" }}
|
||||||
|
load-frontend:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.13.0
|
||||||
|
steps:
|
||||||
|
- attach_workspace:
|
||||||
|
at: .
|
||||||
- persist_to_workspace:
|
- persist_to_workspace:
|
||||||
root: .
|
root: .
|
||||||
paths:
|
paths:
|
||||||
- "src/plugins/nonebot_bison/admin_page/dist/"
|
- "./src/plugins/nonebot_bison/admin_page/dist/"
|
||||||
test:
|
test:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/python:3.9
|
- image: cimg/python:3.9
|
||||||
|
Loading…
x
Reference in New Issue
Block a user