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
58 changes: 47 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,32 @@ 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
name: Run Ruff linter
command: |
ruff check . --fix
ruff format .
ruff check .github/scripts/ || true
- run:
name: Run MyPy type checker
command: mypy . || echo "MyPy found issues but continuing"
command: mypy .github/scripts/ || echo "MyPy found issues but continuing"
- run:
name: Run pytest
command: pytest || echo "No tests found"

node-checks:
docker:
- image: cimg/node:20.18
- image: cimg/node:22.19
steps:
- checkout
- run:
name: Install dependencies
name: Install pnpm
command: sudo npm install -g pnpm
- run:
name: Install root dependencies
command: pnpm install --frozen-lockfile
- run:
name: Install functions dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
cd functions
npm install --legacy-peer-deps
- run:
name: Run linting
command: |
Expand All @@ -42,14 +47,45 @@ jobs:
name: TypeScript type check
command: |
cd functions
npx tsc --noEmit
./node_modules/.bin/tsc --noEmit

deploy-worker:
docker:
- image: cimg/node:22.19
steps:
- checkout
- run:
name: Quality GC check
command: npx quality-gc run || echo "Quality GC issues found"
name: Install pnpm
command: sudo npm install -g pnpm
- run:
name: Install dependencies
command: pnpm install --frozen-lockfile
- run:
name: Deploy YouTube API Worker to Cloudflare
command: |
if [ -z "$CLOUDFLARE_API_TOKEN" ]; then
echo "WARNING: CLOUDFLARE_API_TOKEN not set. Skipping worker deployment."
exit 0
fi
./node_modules/.bin/wrangler deploy src/youtube-worker.ts --name ytstudio

workflows:
version: 2

validate:
jobs:
- python-checks
- node-checks

deploy:
jobs:
- node-checks:
filters:
branches:
only: main
- deploy-worker:
requires:
- node-checks
filters:
branches:
only: main
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