Unverified Commit 9aaca3ca authored by Licho's avatar Licho Committed by GitHub

separate npm build steps out (#1224)

* feat: compatible java 11 * feat: add action for java 11 Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * fix: jdk 8 use 11 target Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * feat: action npm only on jdk 8 Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * feat: separate npm build out Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * fix: name wrong Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * feat: impove npm cache Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * fix: errr Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * Empty Signed-off-by: 's avatarlicho <lecho.sun@gmail.com>
parent 1698af3b
...@@ -31,40 +31,43 @@ concurrency: ...@@ -31,40 +31,43 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build: build_npm:
name: Build name: Build_NPM
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
jdk: [8, 11]
timeout-minutes: 30 timeout-minutes: 30
env: env:
MAVEN_OPTS: -Xmx2G -Xms2G MAVEN_OPTS: -Xmx2G -Xms2G
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: actions/setup-node@v3
# 编译web
- name: Cache node modules
if: matrix.jdk == 8
uses: actions/cache@v2
with: with:
# npm cache files are stored in `~/.npm` on Linux/macOS node-version: 16
path: | - name: Get npm cache directory
dlink-web/node_modules id: npm-cache-dir
dlink-web/dist run: |
key: ${{ runner.os }}-node-${{ hashFiles('dlink-web/**/package.json') }} echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v3
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: | restore-keys: |
${{ runner.os }}-node- ${{ runner.os }}-node-
- name: Install Dependencies - name: Install Dependencies
if: matrix.jdk == 8 run: cd dlink-web && npm install --legacy-peer-deps
run: cd dlink-web && npm install --force
- name: Npm Web Build - name: Npm Web Build
if: matrix.jdk == 8
run: cd dlink-web && npm run build run: cd dlink-web && npm run build
build_jdk:
name: Build_JDK
runs-on: ubuntu-latest
strategy:
matrix:
jdk: [8, 11]
timeout-minutes: 30
env:
MAVEN_OPTS: -Xmx2G -Xms2G
steps:
- uses: actions/checkout@v3
# maven编译 # maven编译
- name: Set up JDK ${{ matrix.jdk }} - name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2 uses: actions/setup-java@v2
...@@ -72,7 +75,7 @@ jobs: ...@@ -72,7 +75,7 @@ jobs:
java-version: ${{ matrix.jdk }} java-version: ${{ matrix.jdk }}
distribution: 'adopt' distribution: 'adopt'
- name: Cache local Maven repository - name: Cache local Maven repository
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: ~/.m2/repository path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment