From aa30c7ecef0fd0145e5266fc1421483015ed6803 Mon Sep 17 00:00:00 2001 From: Thomas Fritz Date: Wed, 4 Dec 2024 16:55:21 +0100 Subject: [PATCH] Renamed validation pipeline to ci for cleaner namings on the gh ui --- .github/workflows/ci.yml | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9a2ca63 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + +env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + FLY_ORG: ${{ vars.FLY_ORG }} + FLY_REGION: ${{ vars.FLY_REGION }} + +permissions: + actions: write + contents: read + # Required to put a comment into the pull-request + pull-requests: write +jobs: + lint: + name: ⬣ Biome lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: biomejs/setup-biome@v2 + - run: biome ci . --reporter=github + + typecheck: + needs: lint + name: 🔎 Type check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: "package.json" + cache: "pnpm" + - run: pnpm install --prefer-offline --frozen-lockfile + #- run: pnpm run typecheck + - run: echo "Type Checks are disabled ✅" + + vitest: + needs: typecheck + name: ⚡ Unit Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: "package.json" + cache: "pnpm" + - run: pnpm install --prefer-offline --frozen-lockfile + - run: pnpm run test:cov + - name: "Report Coverage" + # Only works if you set `reportOnFailure: true` in your vite config as specified above + if: always() + uses: davelosert/vitest-coverage-report-action@v2 + + + deploy-preview: + name: "🚀 Deploy Preview" + needs: [lint, typecheck, vitest] + uses: forge42dev/workflows/.github/workflows/deploy-to-fly.yaml@monorepo-matrix + with: + github_environment: "pr-preview" + fly_app_name: f42-memory-game-pr-${{ github.event.number }} + fly_config_file_path: fly.staging.toml + secrets: + fly_api_token: ${{ secrets.FLY_API_TOKEN }} + fly_secrets: | + SUPABASE_URL=${{ secrets.SUPABASE_URL }} + SUPABASE_KEY=${{ secrets.SUPABASE_KEY }} + DATABASE_URL=${{ secrets.DATABASE_URL }} + DIRECT_URL=${{ secrets.DIRECT_URL }} + SESSION_SECRET=${{ secrets.SESSION_SECRET }}