chore: no builds #153
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: Validate | |
on: | |
pull_request: | |
push: | |
branches: | |
- rc | |
- main | |
env: | |
PW_TEST_HTML_REPORT_OPEN: 'never' | |
jobs: | |
repo: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
lfs: 'true' | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: node_modules cache | |
id: npm-cache | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node_modules-${{hashFiles('**/package-lock.json')}} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
shell: bash | |
env: | |
NODE_OPTIONS: '--max_old_space_size=8192' | |
run: npm ci --prefer-offline --no-audit --progress=false --workspaces --include-workspace-root | |
- name: Stylelint | |
run: npm run test:stylelint | |
- name: Git | |
run: npm run test:git | |
validation: | |
needs: repo | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
[ | |
core, | |
core-util, | |
dashboard, | |
data-mocked, | |
dev-env, | |
doc-site, | |
helpers, | |
react-components, | |
scene-composer, | |
source-iotsitewise, | |
source-iottwinmaker, | |
tools-iottwinmaker, | |
] | |
task: [build, lint] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: node_modules cache | |
id: npm-cache | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node_modules-${{hashFiles('**/package-lock.json')}} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
shell: bash | |
env: | |
NODE_OPTIONS: '--max_old_space_size=8192' | |
run: npm ci --prefer-offline --no-audit --progress=false --workspaces --include-workspace-root | |
- name: Turbo cache | |
uses: actions/cache@v4 | |
with: | |
path: '.turbo' | |
key: ${{ runner.os }}-turbo-${{ matrix.task }}-${{ matrix.package }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo-${{ matrix.task }}-${{ matrix.package }}- | |
- name: Validate | |
run: npx turbo ${{ matrix.task }} --filter=@iot-app-kit/${{ matrix.package }} | |
unit-test: | |
needs: repo | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
[ | |
{ name: 'core', shardIndex: 1, totalShards: 1 }, | |
{ name: 'core-util', shardIndex: 1, totalShards: 1 }, | |
{ name: 'dashboard', shardIndex: 1, totalShards: 2 }, | |
{ name: 'dashboard', shardIndex: 2, totalShards: 2 }, | |
{ name: 'react-components', shardIndex: 1, totalShards: 2 }, | |
{ name: 'react-components', shardIndex: 2, totalShards: 2 }, | |
{ name: 'scene-composer', shardIndex: 1, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 2, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 3, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 4, totalShards: 4 }, | |
{ name: 'source-iotsitewise', shardIndex: 1, totalShards: 1 }, | |
{ name: 'source-iottwinmaker', shardIndex: 1, totalShards: 1 }, | |
{ name: 'tools-iottwinmaker', shardIndex: 1, totalShards: 1 }, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: node_modules cache | |
id: npm-cache | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node_modules-${{hashFiles('**/package-lock.json')}} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
shell: bash | |
env: | |
NODE_OPTIONS: '--max_old_space_size=8192' | |
run: npm ci --prefer-offline --no-audit --progress=false --workspaces --include-workspace-root | |
- name: Turbo cache | |
uses: actions/cache@v4 | |
with: | |
path: '.turbo' | |
key: ${{ runner.os }}-turbo-unit-test-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo-unit-test-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}- | |
- name: Validate | |
run: npx turbo test --filter=@iot-app-kit/${{ matrix.package.name }} -- --shard=${{ matrix.package.shardIndex }}/${{ matrix.package.totalShards }} | |
playwright: | |
needs: repo | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
[ | |
{ name: 'dev-env', shardIndex: 1, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 2, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 3, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 4, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 5, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 6, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 7, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 8, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 9, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 10, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 11, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 12, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 13, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 14, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 15, totalShards: 16 }, | |
{ name: 'dev-env', shardIndex: 16, totalShards: 16 }, | |
{ name: 'react-components', shardIndex: 1, totalShards: 2 }, | |
{ name: 'react-components', shardIndex: 2, totalShards: 2 }, | |
{ name: 'scene-composer', shardIndex: 1, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 2, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 3, totalShards: 4 }, | |
{ name: 'scene-composer', shardIndex: 4, totalShards: 4 }, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
cache-dependency-path: '**/package-lock.json' | |
- name: node_modules cache | |
id: npm-cache | |
uses: actions/cache@v4 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node_modules-${{hashFiles('**/package-lock.json')}} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install | |
if: steps.npm-cache.outputs.cache-hit != 'true' | |
env: | |
NODE_OPTIONS: '--max_old_space_size=8192' | |
run: npm ci --prefer-offline --no-audit --progress=false --workspaces --include-workspace-root | |
- name: Turbo cache | |
uses: actions/cache@v4 | |
with: | |
path: '.turbo' | |
key: ${{ runner.os }}-turbo-playwright-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo-playwright-${{ matrix.package.name }}-${{ matrix.package.shardIndex }}- | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "::set-output name=version::$(npm info @playwright/test version)" | |
- name: Playwright cache | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' | |
restore-keys: | | |
${{ runner.os }}-playwright- | |
- name: Install Playwright with dependencies | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
run: npx playwright install --with-deps | |
- name: Install Playwright's dependencies | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
run: npx playwright install-deps | |
- name: Playwright | |
run: | | |
npx turbo test:ui:ci --filter=@iot-app-kit/${{ matrix.package.name }} -- --shard=${{ matrix.package.shardIndex }}/${{ matrix.package.totalShards }} | |
- name: Test report | |
id: upload-test-report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: ${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-playwright-report | |
path: packages/**/playwright-report | |
retention-days: 30 | |
- name: Failure report | |
id: upload-failure-report | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: ${{ matrix.package.name }}-${{ matrix.package.shardIndex }}-test-results | |
path: packages/**/test-results | |
retention-days: 30 |