Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

Run lint, typecheck and format checks on every pull request

Anmol Kapil4de37883f9f5
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..4e7fd64
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,41 @@
+name: CI
+
+on:
+ pull_request:
+ branches: [main]
+ push:
+ branches: [main]
+
+# A second push to a PR makes the first run's answer irrelevant, so don't
+# spend a runner finishing it.
+concurrency:
+ group: ci-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ ci:
+ name: ci
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 22
+ cache: npm
+
+ # --ignore-scripts skips Electron's binary download and
+ # electron-builder's native rebuild. Both are needed to *run* the app;
+ # linting, typechecking and format-checking need only the packages
+ # themselves, and that download would otherwise dominate every run.
+ - name: Install dependencies
+ run: npm ci --ignore-scripts
+
+ - name: Lint
+ run: npm run lint
+
+ - name: Typecheck
+ run: npm run typecheck
+
+ - name: Check formatting
+ run: npm run format:check
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4e2d19a..f5c2858 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,6 +21,10 @@ npm run typecheck
npm run format
```
+CI runs the same three checks on every pull request, with formatting checked rather than applied — if it flags something, `npm run format` fixes it.
+
+`main` takes changes by pull request only: direct pushes and force-pushes are rejected, and CI has to be green before a PR can merge.
+
There's no test suite yet, so please describe how you tested your change manually (which URL/file size/interfaces you tried) in the PR description.
## Making changes
@@ -33,6 +37,7 @@ There's no test suite yet, so please describe how you tested your change manuall
## Reporting bugs
Open a GitHub issue with:
+
- macOS version
- What you were downloading (URL if it's public, or roughly: file size, server type)
- Which network interfaces were involved
diff --git a/package.json b/package.json
index d5a08b1..285d0dd 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
"author": "Anmol Kapil",
"scripts": {
"format": "prettier --write .",
+ "format:check": "prettier --check .",
"lint": "eslint --cache .",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",