2022-01-14 05:17:38 +00:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- development
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/build.yml'
|
|
|
|
- 'packages/**/*'
|
2023-05-22 14:13:33 +00:00
|
|
|
- '!packages/**/*.md'
|
|
|
|
- '!packages/docs/*'
|
2022-01-14 05:17:38 +00:00
|
|
|
- 'scripts/**/*'
|
|
|
|
- 'babel.config.js'
|
|
|
|
- 'package.json'
|
|
|
|
- 'webpack.config.js'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- development
|
|
|
|
paths:
|
|
|
|
- '.github/workflows/build.yml'
|
|
|
|
- 'packages/**/*'
|
2023-05-22 14:13:33 +00:00
|
|
|
- '!packages/**/*.md'
|
|
|
|
- '!packages/docs/*'
|
2022-01-14 05:17:38 +00:00
|
|
|
- 'scripts/**/*'
|
|
|
|
- 'babel.config.js'
|
|
|
|
- 'package.json'
|
|
|
|
- 'webpack.config.js'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
# we want to run the full build on all os: don't cancel running jobs even if one fails
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-12-14 13:16:13 +00:00
|
|
|
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
|
2022-01-14 05:17:38 +00:00
|
|
|
steps:
|
2023-09-11 06:58:05 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-01-14 05:17:38 +00:00
|
|
|
- name: Setup node
|
2022-07-05 06:08:25 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-14 05:17:38 +00:00
|
|
|
with:
|
2022-07-05 06:08:25 +00:00
|
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Install dependencies
|
2022-01-14 05:17:38 +00:00
|
|
|
run: npm install
|
2022-07-05 06:08:25 +00:00
|
|
|
- name: Build @maxgraph/core - umd
|
|
|
|
working-directory: packages/core
|
|
|
|
run: npm run build
|
|
|
|
- name: Build @maxgraph/core - esm
|
|
|
|
working-directory: packages/core
|
|
|
|
run: npm run generate-esm
|
|
|
|
- name: Generate @maxgraph/core types
|
|
|
|
working-directory: packages/core
|
2022-04-03 11:09:24 +00:00
|
|
|
run: npm run generate-types
|
2022-12-16 15:51:51 +00:00
|
|
|
- name: Test @maxgraph/core
|
|
|
|
working-directory: packages/core
|
|
|
|
run: npm test
|
2022-11-07 17:31:40 +00:00
|
|
|
- name: Test TypeScript support
|
|
|
|
working-directory: packages/ts-support
|
|
|
|
run: npm test
|
2022-07-05 06:08:25 +00:00
|
|
|
- name: Build ts-example
|
|
|
|
working-directory: packages/ts-example
|
|
|
|
run: npm run build
|
2023-10-12 21:41:37 +00:00
|
|
|
- name: Build Storybook mini-site
|
|
|
|
working-directory: packages/html
|
|
|
|
run: npm run build
|
|
|
|
- name: Upload all examples as artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: bundles-test-results-${{github.sha}}
|
|
|
|
path: |
|
|
|
|
packages/html/dist/
|
|
|
|
packages/ts-example/dist/
|
|
|
|
- name: Ensure no lint errors
|
|
|
|
run: npm run lint
|