diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f066891ee2..3970186f5e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,6 +18,7 @@ jobs: - name: pnpm setup uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda - name: pnpm Cache + id: pnpm-cache uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 with: path: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 45b6a5846c..21ed1b622c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,8 @@ permissions: contents: read pull-requests: read jobs: - build: + build-and-test: + name: build and test runs-on: buildjet-4vcpu-ubuntu-2204 outputs: cache-hit: ${{ steps.pnpm-cache.outputs.cache-hit }} @@ -17,15 +18,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - - name: Enable Corepack - id: pnpm-setup - run: | - corepack enable - corepack prepare pnpm@9.15.0 --activate - pnpm config set script-shell "/usr/bin/bash" - + - name: pnpm setup + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda - name: pnpm Cache + id: pnpm-cache uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 with: path: | @@ -35,11 +31,9 @@ jobs: key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm- - - name: Install packages if: steps.pnpm-cache.outputs.cache-hit != 'true' run: pnpm install --frozen-lockfile - - name: turborepo Cache uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 with: @@ -48,47 +42,18 @@ jobs: key: ${{ runner.os }}-turbo-${{ github.sha }} restore-keys: | ${{ runner.os }}-turbo- - - name: Run Build run: pnpm build - test: - runs-on: buildjet-4vcpu-ubuntu-2204 - needs: [build] - container: - image: node:22 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup pnpm - run: | - corepack enable - corepack prepare pnpm@9.15.0 --activate - - - name: Restore dependencies - uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 - with: - path: | - ~/.pnpm-store - node_modules - */*/node_modules - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - - - name: turborepo Cache - uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 - with: - path: | - .turbo - key: ${{ runner.os }}-turbo-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-turbo- - + # We include the environment variables here so that the cache for turborepo + # is not invalidated and builds are re-ran + env: + SPAM_ASSASSIN_HOST: ${{ secrets.SPAM_ASSASSIN_HOST }} + SPAM_ASSASSIN_PORT: ${{ secrets.SPAM_ASSASSIN_PORT }} - name: Run Tests run: pnpm test env: SPAM_ASSASSIN_HOST: ${{ secrets.SPAM_ASSASSIN_HOST }} SPAM_ASSASSIN_PORT: ${{ secrets.SPAM_ASSASSIN_PORT }} - dependencies: runs-on: buildjet-4vcpu-ubuntu-2204 container: @@ -96,6 +61,5 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Check for pinned dependencies run: npx tsx ./scripts/check-dependency-versions.ts diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 4078cd426b..c3b2c4bb36 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -27,14 +27,11 @@ jobs: with: node-version: 22 - - name: Enable Corepack - id: pnpm-setup - run: | - corepack enable - corepack prepare pnpm@9.15.0 --activate - pnpm config set script-shell "/usr/bin/bash" + - name: pnpm setup + uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda - name: pnpm Cache + id: pnpm-cache uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 with: path: | diff --git a/turbo.json b/turbo.json index 23f0ff815e..1b8fd94177 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,6 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["**/.env.*local"], + "globalDependencies": ["**/.env.*local", "pnpm-lock.yaml"], "globalEnv": [ "SUPABASE_URL", "SUPABASE_ANON_KEY", @@ -36,10 +36,6 @@ "test": { "dependsOn": ["^build"] }, - "@react-email/tailwind#test": { - "dependsOn": ["build"], - "cache": false - }, "test:watch": { "cache": false },