aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMiodec <[email protected]>2024-07-22 13:02:10 +0200
committerMiodec <[email protected]>2024-07-22 13:02:13 +0200
commit03f79e9a93c6d3c20a72b35732dccd19a93b6305 (patch)
treeb688bb92aa86d6f0103d7c80e8ab9c5d6e5d342e
parent47f851158f472b62d8b17471a8ff674841902a14 (diff)
downloadmonkeytype-03f79e9a93c6d3c20a72b35732dccd19a93b6305.tar.gz
monkeytype-03f79e9a93c6d3c20a72b35732dccd19a93b6305.zip
add packages step to ci
-rw-r--r--.github/workflows/monkey-ci.yml31
-rw-r--r--package.json1
2 files changed, 32 insertions, 0 deletions
diff --git a/.github/workflows/monkey-ci.yml b/.github/workflows/monkey-ci.yml
index 52caeed2a..2c071c924 100644
--- a/.github/workflows/monkey-ci.yml
+++ b/.github/workflows/monkey-ci.yml
@@ -28,6 +28,7 @@ jobs:
outputs:
should-build-be: ${{ steps.export-changes.outputs.should-build-be }}
should-build-fe: ${{ steps.export-changes.outputs.should-build-fe }}
+ should-build-packages: ${{ steps.export-changes.outputs.should-build-fe }}
assets-json: ${{ steps.export-changes.outputs.assets-json }}
steps:
@@ -42,6 +43,8 @@ jobs:
- 'backend/**/*.{ts,js,json,lua,css,html}'
fe-src:
- 'frontend/**/*.{ts,scss}'
+ packages-src:
+ - 'packages/**/*.{ts}'
anti-cheat:
- 'backend/**/anticheat/**'
@@ -52,6 +55,7 @@ jobs:
- name: Export changes
id: export-changes
run: |
+ echo "should-build-packages=${{ steps.filter.outputs.packages-src }}" >> $GITHUB_OUTPUT
echo "should-build-be=${{ steps.filter.outputs.be-src }}" >> $GITHUB_OUTPUT
echo "should-build-fe=${{ steps.filter.outputs.fe-src }}" >> $GITHUB_OUTPUT
echo "assets-json=${{ steps.filter.outputs.json }}" >> $GITHUB_OUTPUT
@@ -158,6 +162,33 @@ jobs:
if: steps.filter.outputs.other-json == 'true'
run: npm run pr-check-other-json
+ ci-packages:
+ name: ci-packages
+ needs: [pre-ci]
+ runs-on: ubuntu-latest
+ if: needs.pre-ci.outputs.should-build-packages == 'true'
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: ${{ env.NODE_VERSION }}
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Check pretty
+ run: npm run pretty-code-packages
+
+ - name: Check lint
+ run: npx turbo lint --filter="./packages/*"
+
+ - name: Build
+ run: npx turbo build --filter="./packages/*"
+
+ - name: Test
+ run: npx turbo test --filter="./packages/*"
+
on-failure:
permissions: write-all
name: on-failure
diff --git a/package.json b/package.json
index 90196b524..6af42a3d6 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"pretty-code": "prettier --check \"./backend/**/*.{ts,js,json,css,html}\" \"./frontend/**/*.{ts,js}\" \"./packages/**/*.{ts,js,json}\" \"./frontend/src/**/*.scss\" ",
"pretty-code-be": "prettier --check \"./backend/**/*.{ts,js,json,css,html}\"",
"pretty-code-fe": "prettier --check \"./frontend/**/*.{ts,js}\" \"./frontend/src/**/*.scss\"",
+ "pretty-code-packages": "prettier --check \"./packages/src/**/*.{ts,js}\"",
"pretty-fix": "prettier --write \"./backend/**/*.{ts,json,js,css,html}\" \"./frontend/**/*.{ts,js,scss}\" \"./packages/**/*.{ts,js,json}\" \"./frontend/static/**/*.{json,html,css}\"",
"pr-check-lint-json": "cd frontend && eslint './static/**/*.json'",
"pr-check-quote-json": "cd frontend && npx gulp pr-check-quote-json",