Skip to content

Commit dc1cb94

Browse files
authored
feat(ci): faster runs (#2191)
1 parent 856cb24 commit dc1cb94

File tree

4 files changed

+15
-57
lines changed

4 files changed

+15
-57
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- name: pnpm setup
1919
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
2020
- name: pnpm Cache
21+
id: pnpm-cache
2122
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
2223
with:
2324
path: |

.github/workflows/tests.yml

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ permissions:
88
contents: read
99
pull-requests: read
1010
jobs:
11-
build:
11+
build-and-test:
12+
name: build and test
1213
runs-on: buildjet-4vcpu-ubuntu-2204
1314
outputs:
1415
cache-hit: ${{ steps.pnpm-cache.outputs.cache-hit }}
@@ -17,15 +18,10 @@ jobs:
1718
steps:
1819
- name: Checkout
1920
uses: actions/checkout@v4
20-
21-
- name: Enable Corepack
22-
id: pnpm-setup
23-
run: |
24-
corepack enable
25-
corepack prepare [email protected] --activate
26-
pnpm config set script-shell "/usr/bin/bash"
27-
21+
- name: pnpm setup
22+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
2823
- name: pnpm Cache
24+
id: pnpm-cache
2925
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
3026
with:
3127
path: |
@@ -35,11 +31,9 @@ jobs:
3531
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
3632
restore-keys: |
3733
${{ runner.os }}-pnpm-
38-
3934
- name: Install packages
4035
if: steps.pnpm-cache.outputs.cache-hit != 'true'
4136
run: pnpm install --frozen-lockfile
42-
4337
- name: turborepo Cache
4438
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
4539
with:
@@ -48,54 +42,24 @@ jobs:
4842
key: ${{ runner.os }}-turbo-${{ github.sha }}
4943
restore-keys: |
5044
${{ runner.os }}-turbo-
51-
5245
- name: Run Build
5346
run: pnpm build
54-
test:
55-
runs-on: buildjet-4vcpu-ubuntu-2204
56-
needs: [build]
57-
container:
58-
image: node:22
59-
steps:
60-
- name: Checkout
61-
uses: actions/checkout@v4
62-
63-
- name: Setup pnpm
64-
run: |
65-
corepack enable
66-
corepack prepare [email protected] --activate
67-
68-
- name: Restore dependencies
69-
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
70-
with:
71-
path: |
72-
~/.pnpm-store
73-
node_modules
74-
*/*/node_modules
75-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
76-
77-
- name: turborepo Cache
78-
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
79-
with:
80-
path: |
81-
.turbo
82-
key: ${{ runner.os }}-turbo-${{ github.sha }}
83-
restore-keys: |
84-
${{ runner.os }}-turbo-
85-
47+
# We include the environment variables here so that the cache for turborepo
48+
# is not invalidated and builds are re-ran
49+
env:
50+
SPAM_ASSASSIN_HOST: ${{ secrets.SPAM_ASSASSIN_HOST }}
51+
SPAM_ASSASSIN_PORT: ${{ secrets.SPAM_ASSASSIN_PORT }}
8652
- name: Run Tests
8753
run: pnpm test
8854
env:
8955
SPAM_ASSASSIN_HOST: ${{ secrets.SPAM_ASSASSIN_HOST }}
9056
SPAM_ASSASSIN_PORT: ${{ secrets.SPAM_ASSASSIN_PORT }}
91-
9257
dependencies:
9358
runs-on: buildjet-4vcpu-ubuntu-2204
9459
container:
9560
image: node:22
9661
steps:
9762
- name: Checkout
9863
uses: actions/checkout@v4
99-
10064
- name: Check for pinned dependencies
10165
run: npx tsx ./scripts/check-dependency-versions.ts

.github/workflows/version.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ jobs:
2727
with:
2828
node-version: 22
2929

30-
- name: Enable Corepack
31-
id: pnpm-setup
32-
run: |
33-
corepack enable
34-
corepack prepare [email protected] --activate
35-
pnpm config set script-shell "/usr/bin/bash"
30+
- name: pnpm setup
31+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda
3632

3733
- name: pnpm Cache
34+
id: pnpm-cache
3835
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4
3936
with:
4037
path: |

turbo.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://turbo.build/schema.json",
3-
"globalDependencies": ["**/.env.*local"],
3+
"globalDependencies": ["**/.env.*local", "pnpm-lock.yaml"],
44
"globalEnv": [
55
"SUPABASE_URL",
66
"SUPABASE_ANON_KEY",
@@ -36,10 +36,6 @@
3636
"test": {
3737
"dependsOn": ["^build"]
3838
},
39-
"@react-email/tailwind#test": {
40-
"dependsOn": ["build"],
41-
"cache": false
42-
},
4339
"test:watch": {
4440
"cache": false
4541
},

0 commit comments

Comments
 (0)