From 2e76a7dbaec343c004732c795bf94806d229362e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 30 Jun 2024 16:46:44 -0300 Subject: [PATCH] chore: add CodeQL --- .github/workflows/quality.yml | 76 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 38 ------------------ 2 files changed, 76 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/quality.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..65f2b3f --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,76 @@ +name: test and analyze + +on: + workflow_dispatch: + push: + branches: [ "develop", "master" ] + paths: + - 'src/**' + - '__tests__/**' + pull_request: + branches: [ "develop", "master" ] + paths: + - 'src/**' + - '__tests__/**' + + +jobs: + test: + name: test + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' + steps: + + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: set environment variables + run: | + touch .env + echo "TURSO_URL=${{ secrets.TURSO_URL }}" >> .env + echo "TURSO_DB_TOKEN=${{ secrets.TURSO_DB_TOKEN }}" >> .env + + - name: install dependencies and test + run: | + bun install + bun test + + analyze: + name: Analyze (${{ matrix.language }}) + needs: [test] + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 3699565..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: test - -on: - workflow_dispatch: - push: - branches: [ "develop", "master" ] - paths: - - 'src/**' - - '__tests__/**' - pull_request: - branches: [ "develop", "master" ] - paths: - - 'src/**' - - '__tests__/**' - - -jobs: - test: - name: test - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' - steps: - - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: set environment variables - run: | - touch .env - echo "TURSO_URL=${{ secrets.TURSO_URL }}" >> .env - echo "TURSO_DB_TOKEN=${{ secrets.TURSO_DB_TOKEN }}" >> .env - - - name: install dependencies and test - run: | - bun install - bun test \ No newline at end of file