Skip to content

feat(ci): faster runs #2191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
56 changes: 10 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -17,15 +18,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare [email protected] --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: |
Expand All @@ -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:
Expand All @@ -48,54 +42,24 @@ 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 [email protected] --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:
image: node:22
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check for pinned dependencies
run: npx tsx ./scripts/check-dependency-versions.ts
9 changes: 3 additions & 6 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,11 @@ jobs:
with:
node-version: 22

- name: Enable Corepack
id: pnpm-setup
run: |
corepack enable
corepack prepare [email protected] --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: |
Expand Down
6 changes: 1 addition & 5 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -36,10 +36,6 @@
"test": {
"dependsOn": ["^build"]
},
"@react-email/tailwind#test": {
"dependsOn": ["build"],
"cache": false
},
"test:watch": {
"cache": false
},
Expand Down