Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stylelint-config-recommended-less failures due to pnpm workspace #37

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
with:
package: '@shopify/stylelint-plugin'
stylelint-version: stylelint@latest
install-command: yarn
test-command: NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest
--runInBand
install-command: yarn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
with:
package: '@shopify/stylelint-plugin'
stylelint-version: stylelint/stylelint
install-command: yarn
test-command: NODE_OPTIONS="--experimental-vm-modules --no-warnings" npx jest
--runInBand
install-command: yarn

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/test-package-stylelint-less-d99.latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ jobs:
with:
package: stylelint-less
stylelint-version: stylelint@latest
install-command: pnpm i
build-command: pnpm -r build
test-command: pnpm -r test
3 changes: 3 additions & 0 deletions .github/workflows/test-package-stylelint-less-d99.next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ jobs:
with:
package: stylelint-less
stylelint-version: stylelint/stylelint
install-command: pnpm i
build-command: pnpm -r build
test-command: pnpm -r test
15 changes: 10 additions & 5 deletions .github/workflows/test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ on:
type: string
description: The Stylelint version to test
required: true
test-command:
type: string
description: The test command to run
default: 'npm test'
install-command:
type: string
description: The install command to run
default: 'npm install --no-audit'
build-command:
type: string
description: The build command to run
default: 'npm run build --if-present'
test-command:
type: string
description: The test command to run
default: 'npm test'

jobs:
test:
Expand Down Expand Up @@ -96,8 +100,9 @@ jobs:
working-directory: ${{ steps.repo-info.outputs.directory }}
env:
PACKAGE_URL: ${{ steps.repo-info.outputs.url }}
BUILD_COMMAND: ${{ inputs.build-command }}
run: |
if ! npm run build --if-present; then
if ! eval "$BUILD_COMMAND"; then
echo "::error ::The build failed. Visit ${PACKAGE_URL}"
exit 1
fi
Expand Down
6 changes: 4 additions & 2 deletions data/ecosystem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ packages:
- 'stylelint-config-rational-order'
- 'stylelint-config-recess-order'
- 'stylelint-config-recommended'
- 'stylelint-config-recommended-less'
- 'stylelint-config-recommended-scss'
- 'stylelint-config-recommended-vue'
- 'stylelint-config-sass-guidelines'
Expand All @@ -39,7 +38,10 @@ packages:
- 'stylelint-declaration-strict-value'
- 'stylelint-formatter-pretty'
- 'stylelint-high-performance-animation'
- 'stylelint-less'
- [
'stylelint-less',
{ install-command: 'pnpm i', build-command: 'pnpm -r build', test-command: 'pnpm -r test' },
]
- 'stylelint-media-use-custom-media'
- 'stylelint-no-unsupported-browser-features'
- 'stylelint-order'
Expand Down
12 changes: 8 additions & 4 deletions scripts/update-workflows.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ function generateWorkflow({
workflow.jobs.test.with.package = pkg;
workflow.jobs.test.with['stylelint-version'] = stylelintVersion;

if (config['test-command']) {
workflow.jobs.test.with['test-command'] = config['test-command'];
}

if (config['install-command']) {
workflow.jobs.test.with['install-command'] = config['install-command'];
}

if (config['build-command']) {
workflow.jobs.test.with['build-command'] = config['build-command'];
}

if (config['test-command']) {
workflow.jobs.test.with['test-command'] = config['test-command'];
}

return workflow;
}

Expand Down
Loading