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
68 changes: 64 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,91 @@ jobs:

node-checks:
docker:
- image: cimg/node:20.18
- image: cimg/node:22.x
steps:
- checkout
- run:
name: Install dependencies
name: Install root dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
- run:
name: Run linting
name: Install functions dependencies
command: |
cd functions
npm install --legacy-peer-deps
- run:
name: Run ESLint on functions
command: |
cd functions
npm run lint -- --max-warnings 0
- run:
name: TypeScript type check
name: TypeScript type check on functions
command: |
cd functions
npx tsc --noEmit
- run:
name: Quality GC check
command: npx quality-gc run || echo "Quality GC issues found"

worker-validate:
docker:
- image: cimg/node:22.x
steps:
- checkout
- run:
name: Install dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
- run:
name: TypeScript check - YouTube API Worker
command: |
pnpm exec tsc --noEmit --target ES2020 --lib ES2020 --moduleResolution bundler \
--types @cloudflare/workers-types \
src/youtube-worker.ts || echo "Type check completed with warnings"
- run:
name: Validate wrangler config
command: |
pnpm wrangler whoami || echo "Cloudflare auth not configured - skipping whoami"
echo "Wrangler config:"
cat wrangler.jsonc

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

workflows:
version: 2

validate:
jobs:
- python-checks
- node-checks
- worker-validate:
requires:
- node-checks

deploy:
jobs:
- worker-deploy:
filters:
branches:
only: main
35 changes: 34 additions & 1 deletion functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
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: [
".eslintrc.js",
"/lib/**/*",
"/generated/**/*",
],
plugins: [
"@typescript-eslint",
"import",
],
rules: {
quotes: ["error", "double"],
"import/no-unresolved": 0,
indent: ["error", 2],
},
};
Loading
Loading