diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9750947..bfb9151 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,23 +1,38 @@ +name: CI +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + workflow_dispatch: jobs: - build: + validate: runs-on: ubuntu-latest - defaults: - run: - working-directory: . # <-- repo root, not loop-engineering/loop-engineering steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 20.x + node-version: 20 cache: npm - cache-dependency-path: | - frontend/package-lock.json - doc/package-lock.json - - name: Install frontend deps - if: hashFiles('frontend/package-lock.json') != '' - working-directory: frontend + cache-dependency-path: tools/loop-audit/package-lock.json + - working-directory: tools/loop-audit run: npm ci - - name: Install docs deps - if: hashFiles('doc/package-lock.json') != '' - working-directory: doc + - working-directory: tools/loop-audit + run: node dist/cli.js .. --level L2 + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: tools/loop-audit/package-lock.json + - working-directory: tools/loop-audit run: npm ci + - working-directory: tools/loop-audit + run: npm run build