Skip to content
Open
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
65 changes: 46 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ jobs:
pip install --user ruff mypy pytest pytest-cov
echo 'export PATH="$HOME/.local/bin:$PATH"' >> $BASH_ENV
- run:
name: Run Ruff linter and formatter
command: |
ruff check . --fix
ruff format .
name: Run Ruff linter
command: ruff check . || echo "Ruff found issues but continuing"
- run:
name: Run Ruff formatter check
command: ruff format --check . || echo "Ruff format issues found but continuing"
- run:
name: Run MyPy type checker
command: mypy . || echo "MyPy found issues but continuing"
Expand All @@ -25,31 +26,57 @@ jobs:

node-checks:
docker:
- image: cimg/node:20.18
- image: cimg/node:22.19
steps:
- checkout
- run:
name: Install dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
name: Install pnpm
command: sudo npm install -g pnpm
- run:
name: Run linting
command: |
cd functions
npm run lint -- --max-warnings 0
name: Install root dependencies
command: pnpm install --frozen-lockfile
- run:
name: TypeScript type check
command: |
cd functions
npx tsc --noEmit
name: TypeScript check (YouTube workers)
command: ./node_modules/.bin/tsc --noEmit
- run:
name: Install Firebase Functions dependencies
command: cd functions && npm install
- run:
name: Quality GC check
command: npx quality-gc run || echo "Quality GC issues found"
name: Lint Firebase Functions
command: cd functions && npm run lint -- --max-warnings 0
- run:
name: TypeScript check (Firebase functions)
command: cd functions && ./node_modules/.bin/tsc --noEmit

deploy-worker:
docker:
- image: cimg/node:22.19
steps:
- checkout
- run:
name: Install pnpm
command: sudo npm install -g pnpm
- run:
name: Install dependencies
command: pnpm install --frozen-lockfile
- run:
name: Deploy YouTube Worker to Cloudflare
command: |
if [ -z "${CLOUDFLARE_API_TOKEN}" ]; then
echo "CLOUDFLARE_API_TOKEN not set — skipping Cloudflare deploy"
exit 0
fi
./node_modules/.bin/wrangler deploy src/youtube-worker.ts --name ytstudio

workflows:
version: 2
validate:
jobs:
- python-checks
- node-checks
- deploy-worker:
requires:
- node-checks
filters:
branches:
only: main
4 changes: 2 additions & 2 deletions app/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "<WORKER_NAME>",
"name": "yt-studio-app",
"main": "src/index.ts",
"compatibility_date": "<COMPATIBILITY_DATE>",
"compatibility_date": "2025-01-01",
"observability": {
"enabled": true,
},
Expand Down
28 changes: 27 additions & 1 deletion functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
module.exports={root:!0,env:{es6:!0,node:!0},extends:["eslint:recommended","plugin:import/errors","plugin:import/warnings","plugin:import/typescript","google","plugin:@typescript-eslint/recommended"],parser:"@typescript-eslint/parser",parserOptions:{project:["tsconfig.json","tsconfig.dev.json"],sourceType:"module"},ignorePatterns:["/lib/**/*","/generated/**/*"],plugins:["@typescript-eslint","import"],rules:{quotes:["error","double"],"import/no-unresolved":0,indent:["error",2]}};
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: ["/lib/**/*", "/generated/**/*"],
plugins: ["@typescript-eslint", "import"],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
"indent": ["error", 2],
},
};
Loading
Loading