fix: packages #185
Workflow file for this run
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 | |
unit: | |
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, | |
] | |
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-${{ matrix.package}}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo-unit-${{ matrix.package}}- | |
- name: Test and lint cache | |
uses: actions/cache@v4 | |
with: | |
path: '**/.cache' | |
key: ${{ runner.os }}-test-lint-${{ matrix.package}}-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-test-lint-${{ matrix.package}}- | |
- name: Validate | |
run: npx turbo build lint test --filter=@iot-app-kit/${{ matrix.package }} | |
playwright: | |
needs: repo | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
strategy: | |
fail-fast: false | |
matrix: | |
package: | |
[ | |
{ name: 'dev-env', shardIndex: 1, totalShards: 4 }, | |
{ name: 'dev-env', shardIndex: 2, totalShards: 4 }, | |
{ name: 'dev-env', shardIndex: 3, totalShards: 4 }, | |
{ name: 'dev-env', shardIndex: 4, totalShards: 4 }, | |
{ name: 'react-components', totalShards: 1, shardIndex: 1 }, | |
{ name: 'scene-composer', totalShards: 1, shardIndex: 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' | |
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 |