Merge pull request #160 from gtn1024/windows-path-support #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-test-webeditor | |
on: | |
push: | |
branches-ignore: | |
- release | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
- versions.json | |
- livestream-data.json | |
pull_request: | |
branches-ignore: | |
- release | |
paths-ignore: | |
- '**/*.md' | |
- 'docs/**' | |
- versions.json | |
- livestream-data.json | |
jobs: | |
build: | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.BYTELEGENDBOT_TOKEN }} | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14.x | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ matrix.node-version }} | |
- run: yarn config set script-shell /bin/bash && yarn | |
working-directory: github1s | |
- run: yarn build:vscode | |
working-directory: github1s | |
- run: yarn yalc | |
working-directory: github1s | |
- run: yarn build && yarn hash | |
working-directory: github1s | |
# don't remove them, otherwise it will be redirected to index.html on CDN and show a lot of warnings in browser console | |
# DevTools failed to load source map: Could not parse content for https://XXXX.js.map: Unexpected token < in JSON at position 0 | |
- run: find github1s/dist -name '*.js.map' -exec cp .github/empty.json {} \; | |
- run: find github1s/dist -name '*.gif' | xargs rm -rf | |
- run: find github1s/dist -name 'learn.svg' | xargs rm -rf | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: webeditor | |
path: github1s/dist | |
test: | |
runs-on: 'ubuntu-latest' | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
token: ${{ secrets.BYTELEGENDBOT_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: webeditor | |
path: github1s/dist | |
- name: Display structure of downloaded files | |
run: ls -alth github1s/dist | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 14.x | |
- run: yarn config set script-shell /bin/bash && yarn install | |
working-directory: github1s | |
- run: yarn serve > ./output 2>&1 & | |
working-directory: github1s | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: 11 | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
# default GITHUB_TOKEN has no access to other repository, but we need to access other repo in WebEditorBrowserTest | |
arguments: > | |
server:app:webEditorBrowserTest | |
-DagreePublicBuildScanTermOfService=yes | |
-Dforest.github.read.token=${{ secrets.BYTELEGENDBOT_TOKEN }} | |
-Dforest.test.enableRecording=true | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: artifacts | |
path: | | |
server/app/build/tmp/**/*.mp4 | |
server/app/build/reports/test |