From a9d222f38834d984c7c1770003e972855bb0cc11 Mon Sep 17 00:00:00 2001 From: Pasqual Koschmieder Date: Tue, 14 Jan 2025 10:44:39 +0100 Subject: [PATCH] ci: add ci and codeql workflows --- .github/workflows/check.yml | 36 +++++++++++++++++++++++++ .github/workflows/codeql.yml | 51 ++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..daa61a4 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,36 @@ +name: CI +on: + push: + branches: [ "**" ] + tags-ignore: [ "**" ] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + cancel-in-progress: true + group: ci-${{ github.event.pull_request.number || github.ref }} + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: true + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: latest + + - name: Run CI + run: pnpm run ci diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..d7e7cca --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,51 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + tags-ignore: [ "**" ] + pull_request: + schedule: + - cron: '00 2 * * *' + +concurrency: + cancel-in-progress: true + group: cq-${{ github.event.pull_request.number || github.job }} + +permissions: + contents: read + security-events: write + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + if: ${{ !startsWith(github.ref, 'refs/heads/renovate/') }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup PNPM + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: true + + - name: Setup Node + uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: latest + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + tools: linked + languages: "javascript-typescript" + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/package.json b/package.json index 32ea7f1..3f18a54 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build": "tsc -b && vite build", "lint": "biome lint && eslint .", "format": "biome format --fix", - "preview": "vite preview" + "preview": "vite preview", + "ci": "biome ci && eslint . --quiet --no-color && pnpm run build" }, "dependencies": { "@tanstack/react-query": "^5.64.0",