Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 16 additions & 28 deletions .github/workflows/TestPWTCommands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ name: Script tests

on:
push:
branches: [master]
branches:
- master
paths:
- 'pnpm-lock.yaml'
- 'packages/generator-widget/**'
- 'packages/pluggable-widgets-tools/**'
- 'packages/command-tests/**'
pull_request:
branches: [master]
branches:
- master
paths:
- 'pnpm-lock.yaml'
- 'packages/generator-widget/**'
- 'packages/pluggable-widgets-tools/**'
- 'packages/command-tests/**'

jobs:
test:
Expand All @@ -20,28 +32,6 @@ jobs:
with:
submodules: false

- name: "Checking changed files"
id: filter
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
if: github.event_name == 'pull_request'
with:
filters: |
packages:
- 'packages/generator-widget/*'
- 'packages/pluggable-widgets-tools/*'
tests:
- 'packages/command-tests/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Defining cache"
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
env:
cache-name: cache-node-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
if: matrix.node == 16
Expand All @@ -60,14 +50,12 @@ jobs:
cache: 'pnpm'

- name: "Installing dependencies"
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: pnpm install

- name: Increase number of watchers
if: (steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true') && startsWith(matrix.os, 'ubuntu')
if: startsWith(matrix.os, 'ubuntu')
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: "Testing PWT commands"
working-directory: ./packages/command-tests
if: steps.filter.outputs.packages == 'true' || steps.filter.outputs.tests == 'true'
run: pnpm test
run: pnpm start
32 changes: 8 additions & 24 deletions .github/workflows/UnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ name: Run unit tests
on:
push:
branches: [master]
paths:
- 'pnpm-lock.yaml'
- 'packages/**'
pull_request:
branches: [master]
paths:
- 'pnpm-lock.yaml'
- 'packages/**'

jobs:
test:
Expand All @@ -17,25 +23,6 @@ jobs:
with:
submodules: false

- name: "Checking changed files"
id: filter
uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
if: github.event_name == 'pull_request'
with:
filters: |
packages:
- 'packages/**/*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Defining cache"
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
env:
cache-name: cache-node-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}

- name: Setup pnpm
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda #v4.1.0
with:
Expand All @@ -48,14 +35,11 @@ jobs:
cache: 'pnpm'

- name: "Installing dependencies"
if: steps.filter.outputs.packages == 'true'
run: pnpm install

- name: "Running unit tests"
if: steps.filter.outputs.packages == 'true'
run: pnpm -r test

- name: "Linting generator-widget"
- name: "Linting packages"
working-directory: ./packages/generator-widget
if: steps.filter.outputs.packages == 'true'
run: pnpm run lint
run: pnpm -r lint
2 changes: 1 addition & 1 deletion packages/command-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"main": "commands.js",
"scripts": {
"test": "node commands.js"
"start": "node commands.js"
},
"devDependencies": {
"@prettier/plugin-xml": "^2.2.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/release-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
},
"devDependencies": {
"@types/node": "^16.11.19",
"@types/node-fetch": "2.6.1",
"@typescript-eslint/eslint-plugin": "^5.40.1",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
Expand Down
19 changes: 11 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading