Skip to content

Commit d96e3dd

Browse files
committed
add stylelint to turbo, full-check and CI
1 parent 5b2182e commit d96e3dd

4 files changed

Lines changed: 23 additions & 6 deletions

File tree

.github/workflows/monkey-ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
should-build-be: ${{ steps.export-changes.outputs.should-build-be }}
2929
should-build-fe: ${{ steps.export-changes.outputs.should-build-fe }}
3030
should-build-pkg: ${{ steps.export-changes.outputs.should-build-pkg }}
31-
assets-json: ${{ steps.export-changes.outputs.assets-json }}
31+
assets-or-styles: ${{ steps.export-changes.outputs.assets-or-styles }}
3232

3333
steps:
3434
- name: Full checkout
@@ -41,8 +41,9 @@ jobs:
4141
id: filter
4242
with:
4343
filters: |
44-
json:
44+
assets-or-styles:
4545
- 'frontend/static/**/*'
46+
- '**/*.{scss,css}'
4647
be-src:
4748
- 'backend/**/*.{ts,js,json,lua,css,html}'
4849
- 'backend/package.json'
@@ -64,13 +65,13 @@ jobs:
6465
echo "should-build-pkg=${{ steps.filter.outputs.pkg-src }}" >> $GITHUB_OUTPUT
6566
echo "should-build-be=${{ steps.filter.outputs.be-src }}" >> $GITHUB_OUTPUT
6667
echo "should-build-fe=${{ steps.filter.outputs.fe-src }}" >> $GITHUB_OUTPUT
67-
echo "assets-json=${{ steps.filter.outputs.json }}" >> $GITHUB_OUTPUT
68+
echo "assets-or-styles=${{ steps.filter.outputs.assets-or-styles }}" >> $GITHUB_OUTPUT
6869
6970
prime-cache:
7071
name: prime-cache
7172
runs-on: ubuntu-latest
7273
needs: [pre-ci]
73-
if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
74+
if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-or-styles == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
7475
steps:
7576
- name: Checkout pnpm-lock
7677
uses: actions/checkout@v4
@@ -216,7 +217,7 @@ jobs:
216217
name: ci-assets
217218
needs: [pre-ci, prime-cache]
218219
runs-on: ubuntu-latest
219-
if: needs.pre-ci.outputs.assets-json == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
220+
if: needs.pre-ci.outputs.assets-or-styles == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci')
220221
steps:
221222
- uses: actions/checkout@v4
222223
with:
@@ -228,6 +229,10 @@ jobs:
228229
id: filter
229230
with:
230231
filters: |
232+
styles:
233+
- '**/*.{scss,css}'
234+
json:
235+
- 'frontend/static/**/*.json'
231236
languages:
232237
- 'frontend/static/languages/**'
233238
quotes:
@@ -265,7 +270,12 @@ jobs:
265270
- name: Install dependencies
266271
run: pnpm install
267272

273+
- name: Lint styles
274+
if: steps.filter.outputs.styles == 'true'
275+
run: npm run lint-styles
276+
268277
- name: Lint JSON
278+
if: steps.filter.outputs.json == 'true'
269279
run: npm run lint-json-assets
270280

271281
- name: Validate language assets

frontend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"scripts": {
77
"lint": "oxlint . --type-aware --type-check",
88
"lint-fast": "oxlint .",
9+
"lint-styles": "stylelint \"**/*.{scss,css}\"",
10+
"lint-styles-fix": "stylelint \"**/*.{scss,css}\" --fix",
911
"lint-json": "eslint static/**/*.json",
1012
"check-assets": "tsx ./scripts/check-assets.ts",
1113
"audit": "vite-bundle-visualizer",

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"preinstall": "npx only-allow pnpm",
9-
"full-check": "turbo lint build test integration-test check-assets --force",
9+
"full-check": "turbo lint build test integration-test lint-styles lint-json check-assets --force",
1010
"prepare": "husky install",
1111
"pre-commit": "lint-staged",
1212
"ts-check": "turbo run ts-check",
@@ -49,6 +49,8 @@
4949
"hotfix-dry": "monkeytype-release --hotfix --dry",
5050
"format-check": "oxfmt . --check",
5151
"format-fix": "oxfmt .",
52+
"lint-styles": "stylelint \"**/*.{scss,css}\"",
53+
"lint-styles-fix": "stylelint \"**/*.{scss,css}\" --fix",
5254
"lint-json-assets": "turbo lint-json --filter @monkeytype/frontend",
5355
"check-assets": "turbo check-assets --filter @monkeytype/frontend",
5456
"check-assets-quotes": "turbo check-assets --filter @monkeytype/frontend -- quotes",

turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
"@monkeytype/frontend#check-assets": {
4343
"dependsOn": ["^parallel", "@monkeytype/schemas#build"]
4444
},
45+
"//#lint-styles": {
46+
"dependsOn": ["^parallel"]
47+
},
4548
"@monkeytype/frontend#lint-json": {
4649
"dependsOn": ["^parallel"]
4750
},

0 commit comments

Comments
 (0)