fix(deps): resolve 35 npm audit vulnerabilities reported in #40 #36
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: ESLint | |
| run: npm run lint | |
| format: | |
| name: Format check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Prettier check | |
| run: npx prettier --check "src/**/*.ts" "test/**/*.ts" | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Nest build | |
| run: npm run build | |
| test: | |
| name: Test (unit) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Jest unit | |
| run: npm run test | |
| test-e2e: | |
| name: Test (e2e) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Jest e2e | |
| # E2e tests need environment variables for Prisma and other services | |
| # Using placeholder values for CI - tests should mock external dependencies | |
| env: | |
| DATABASE_URL: postgresql://test:test@localhost:5432/orbitchain_test | |
| REDIS_URL: redis://localhost:6379 | |
| JWT_SECRET: test-secret-for-ci | |
| NODE_ENV: test | |
| PORT: 3001 | |
| run: npm run test:e2e | |
| prisma-validate: | |
| name: Prisma validate (optional) | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Prisma validate | |
| # Schema uses `url = env("DATABASE_URL")`; prisma validate only checks | |
| # schema syntax and does not connect, but it still needs the var to be | |
| # defined. Inject a dummy URL so the optional job can pass in CI. | |
| env: | |
| DATABASE_URL: postgresql://placeholder:placeholder@localhost:5432/placeholder | |
| run: npx prisma validate | |
| audit: | |
| name: npm audit (production) | |
| runs-on: ubuntu-latest | |
| # Guards against dependency regressions like the one in | |
| # https://github.com/OrbitChainLabs/OrbitChain-API/issues/40 | |
| # Fails on moderate-or-higher advisories in production dependencies. | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| - name: Install | |
| run: npm ci | |
| - name: Verify production dependency audits | |
| run: npm audit --omit=dev --audit-level=moderate |