2020-09-24 20:07:56 +08:00
|
|
|
# Automate, customize, and execute your software development workflows right in your repository with GitHub Actions.
|
|
|
|
# Documentation: https://docs.github.com/en/actions
|
|
|
|
|
2020-08-14 22:34:43 +08:00
|
|
|
name: build
|
|
|
|
|
2024-06-28 00:20:16 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-10-01 17:48:43 +08:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-03-03 21:42:11 +08:00
|
|
|
- develop
|
2024-06-27 05:56:54 +08:00
|
|
|
- next
|
2023-03-03 21:42:11 +08:00
|
|
|
- release/*
|
2020-10-01 17:48:43 +08:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-03-03 21:42:11 +08:00
|
|
|
- develop
|
2024-06-27 05:56:54 +08:00
|
|
|
- next
|
2020-08-14 22:34:43 +08:00
|
|
|
|
|
|
|
jobs:
|
2020-09-24 23:00:46 +08:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-06-11 20:24:10 +08:00
|
|
|
node-version: [20]
|
2020-09-24 23:00:46 +08:00
|
|
|
|
|
|
|
steps:
|
2024-05-02 12:28:20 +08:00
|
|
|
- uses: actions/checkout@v4.1.4
|
2023-02-03 00:37:33 +08:00
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-11-18 15:43:39 +08:00
|
|
|
uses: actions/setup-node@v4.0.0
|
2023-02-03 00:37:33 +08:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Load cached dependencies
|
2024-03-28 02:26:02 +08:00
|
|
|
uses: actions/cache@v4.0.2
|
2023-02-03 00:37:33 +08:00
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
**/node_modules
|
2024-07-04 02:13:55 +08:00
|
|
|
**/.turbo
|
2023-02-03 00:37:33 +08:00
|
|
|
/home/runner/.cache/Cypress
|
|
|
|
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
id: install-dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
# - name: Fix code style linting errors
|
|
|
|
# id: lint-fix
|
|
|
|
# run: npm run lint:fix
|
|
|
|
# continue-on-error: true
|
|
|
|
#
|
|
|
|
# - name: Commit fixed linting errors
|
|
|
|
# id: commit
|
|
|
|
# uses: stefanzweifel/git-auto-commit-action@v4
|
|
|
|
# with:
|
|
|
|
# commit_message: "ci: fix code style linting errors"
|
|
|
|
|
|
|
|
- name: Lint code
|
|
|
|
id: lint
|
|
|
|
run: npm run lint
|
|
|
|
|
2020-08-19 23:30:52 +08:00
|
|
|
test:
|
2020-09-11 18:00:16 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-08-14 22:34:43 +08:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-06-11 20:24:10 +08:00
|
|
|
node-version: [20]
|
2023-03-03 21:42:11 +08:00
|
|
|
test-spec:
|
|
|
|
- { name: "Integration", spec: "./tests/cypress/integration/**/*.spec.{js,ts}" }
|
|
|
|
#- { name: "Demos/Commands", spec: "./demos/src/Commands/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/Examples", spec: "./demos/src/Examples/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/Experiments", spec: "./demos/src/Experiments/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/Extensions", spec: "./demos/src/Extensions/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/GuideContent", spec: "./demos/src/GuideContent/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/GuideGettingStarted", spec: "./demos/src/GuideGettingStarted/**/*.spec.{js,ts}" }
|
|
|
|
#- { name: "Demos/GuideNodeViews", "./demos/src/GuideNodeViews/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/Marks", spec: "./demos/src/Marks/**/*.spec.{js,ts}" }
|
|
|
|
- { name: "Demos/Nodes", spec: "./demos/src/Nodes/**/*.spec.{js,ts}" }
|
|
|
|
#- { name: "Demos/Overview", spec: "./demos/src/Overview/**/*.spec.{js,ts}" }
|
2020-08-14 22:34:43 +08:00
|
|
|
|
|
|
|
steps:
|
2024-05-02 12:28:20 +08:00
|
|
|
- uses: actions/checkout@v4.1.4
|
2023-02-03 00:37:33 +08:00
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-11-18 15:43:39 +08:00
|
|
|
uses: actions/setup-node@v4.0.0
|
2023-02-03 00:37:33 +08:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
id: install-dependencies
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Try to build the packages
|
|
|
|
id: build-packages
|
|
|
|
run: npm run build:pm
|
|
|
|
|
2023-03-03 21:42:11 +08:00
|
|
|
- name: Test ${{ matrix.test-spec.name }}
|
2023-02-03 00:37:33 +08:00
|
|
|
id: cypress
|
2024-08-06 02:34:39 +08:00
|
|
|
uses: cypress-io/github-action@v6.7.2
|
2023-02-03 00:37:33 +08:00
|
|
|
with:
|
|
|
|
cache-key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
|
2024-07-04 00:28:14 +08:00
|
|
|
start: npm run serve
|
2023-02-03 00:37:33 +08:00
|
|
|
wait-on: 'http://localhost:3000'
|
2023-03-03 21:42:11 +08:00
|
|
|
spec: ${{ matrix.test-spec.spec }}
|
2023-02-03 00:37:33 +08:00
|
|
|
project: ./tests
|
|
|
|
browser: chrome
|
|
|
|
quiet: true
|
|
|
|
|
|
|
|
- name: Export screenshots (on failure only)
|
2024-08-12 21:22:09 +08:00
|
|
|
uses: actions/upload-artifact@v4.3.6
|
2023-02-03 00:37:33 +08:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-screenshots
|
|
|
|
path: tests/cypress/screenshots
|
|
|
|
retention-days: 7
|
|
|
|
|
|
|
|
- name: Export screen recordings (on failure only)
|
2024-08-12 21:22:09 +08:00
|
|
|
uses: actions/upload-artifact@v4.3.6
|
2023-02-03 00:37:33 +08:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: cypress-videos
|
|
|
|
path: tests/cypress/videos
|
|
|
|
retention-days: 7
|
|
|
|
|
2020-11-11 21:13:43 +08:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: lint
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-06-11 20:24:10 +08:00
|
|
|
node-version: [20]
|
2020-11-11 21:13:43 +08:00
|
|
|
|
|
|
|
steps:
|
2024-05-02 12:28:20 +08:00
|
|
|
- uses: actions/checkout@v4.1.4
|
2023-02-03 00:37:33 +08:00
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-11-18 15:43:39 +08:00
|
|
|
uses: actions/setup-node@v4.0.0
|
2023-02-03 00:37:33 +08:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Load cached dependencies
|
2024-03-28 02:26:02 +08:00
|
|
|
uses: actions/cache@v4.0.2
|
2023-02-03 00:37:33 +08:00
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
**/node_modules
|
|
|
|
/home/runner/.cache/Cypress
|
|
|
|
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
id: install-dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
- name: Try to build the packages
|
|
|
|
id: build-packages
|
|
|
|
run: npm run build:ci
|