forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (67 loc) · 2.21 KB
/
turborepo-compare-cache-item.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Turborepo Compare Cache Item
on:
workflow_dispatch:
inputs:
version:
description: Turborepo release to test.
type: string
default: "canary"
jobs:
generate_cache_artifact:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: create-turbo
run: |
npm install -g pnpm turbo@${{ inputs.version }}
pnpm dlx create-turbo@${{ inputs.version }} my-turborepo pnpm
- name: Run build
run: |
cd my-turborepo
turbo run build --filter=docs --filter=web --summarize --skip-infer -vvv
- name: Grab Turborepo artifacts
uses: actions/upload-artifact@v4
with:
name: cache-item-${{ matrix.os }}-${{ inputs.version }}
path: |
my-turborepo/node_modules/.cache/turbo
my-turborepo/.turbo/runs
retention-days: 1
use_cache_artifact:
needs: generate_cache_artifact
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
cache_os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: create-turbo
run: |
npm install -g pnpm turbo@${{ inputs.version }}
pnpm dlx create-turbo@${{ inputs.version }} my-turborepo pnpm
- name: Download cache artifacts
uses: actions/download-artifact@v4
with:
name: cache-item-${{ matrix.cache_os }}-${{ inputs.version }}
path: my-turborepo
- name: Check for cache hit
run: |
cd my-turborepo
rm .turbo/runs/*.json
turbo run build --filter=docs --filter=web --summarize --skip-infer -vvv
cat .turbo/runs/*.json | jq -e '.execution.cached == 2'
- name: Check for functional server
run: |
curl https://raw.githubusercontent.com/vercel/turbo/main/scripts/server.js -O
node server.js my-turborepo/apps/docs