From 88f22468bfc79347e692222d7fef6b265124c127 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 7 Jun 2022 22:38:41 +0800 Subject: [PATCH] add node workflow --- .github/workflows/node.yml | 40 +++++++++++++++++++++++++++++++ apps/backtest-report/package.json | 6 ++--- frontend/package.json | 8 +++---- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/node.yml diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml new file mode 100644 index 000000000..d523b2a8a --- /dev/null +++ b/.github/workflows/node.yml @@ -0,0 +1,40 @@ +name: Node.js CI + +on: + push: + branches: [ main ] + paths: + - apps/backtest-report + - frontend + pull_request: + branches: [ main ] + paths: + - apps/backtest-report + - frontend + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [ 16.x ] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install -g yarn + - name: Install + run: yarn install + working-directory: "apps/backtest-report" + - name: Build + run: yarn run next build + working-directory: "apps/backtest-report" + - name: Export + run: yarn run next export + working-directory: "apps/backtest-report" + - run: yarn export + working-directory: "frontend" diff --git a/apps/backtest-report/package.json b/apps/backtest-report/package.json index e3317ab67..dcc8a8d0d 100644 --- a/apps/backtest-report/package.json +++ b/apps/backtest-report/package.json @@ -3,11 +3,11 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", + "dev": "yarn run next dev", + "build": "yarn run next build", "start": "next start", "lint": "next lint", - "export": "next build && next export" + "export": "yarn run next build && yarn run next export" }, "dependencies": { "@mantine/core": "^4.2.5", diff --git a/frontend/package.json b/frontend/package.json index fa8009c3b..110a60b4f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -3,10 +3,10 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "export": "next build && next export" + "dev": "yarn run next dev", + "build": "yarn run next build", + "start": "yarn run next start", + "export": "yarn run next build && yarn run next export" }, "dependencies": { "@material-ui/core": "^4.11.2",