maxGraph/.github/workflows/build.yml

76 lines
2.1 KiB
YAML

name: Build
on:
push:
branches:
- development
paths:
- '.github/workflows/build.yml'
- '.nvmrc'
- 'packages/**/*'
- '!packages/**/*.md'
- '!packages/docs/*'
- 'scripts/**/*'
- 'babel.config.js'
- 'package.json'
- 'webpack.config.js'
pull_request:
branches:
- development
paths:
- '.github/workflows/build.yml'
- 'packages/**/*'
- '!packages/**/*.md'
- '!packages/docs/*'
- '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:
os: ['ubuntu-22.04', 'macos-12', 'windows-2022']
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- 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
run: npm run generate-types
- name: Test @maxgraph/core
working-directory: packages/core
run: npm test
- name: Test TypeScript support
working-directory: packages/ts-support
run: npm test
- name: Build ts-example
working-directory: packages/ts-example
run: npm run build
- 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