-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (67 loc) · 2.29 KB
/
test.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
80
81
name: Test
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-starts:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run TurboRepo Remote Cache Server
uses: ./
with:
storage-provider: local
storage-path: turbo-cache
test-realistic:
runs-on: ubuntu-latest
env:
TURBO_TELEMETRY_DISABLED: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run TurboRepo Remote Cache Server
uses: ./
with:
storage-provider: local
storage-path: turbo-cache
- name: Ensure environmental variables have been set correctly
run: |
echo $TURBO_API | grep -P "^http://127.0.0.1:\d+$"
echo $TURBO_TOKEN | grep -P "^[a-zA-Z0-9]{48}$"
echo $TURBO_TEAM | grep -P "^ci$"
- name: Run turbo:test with turbo and expect no cache
run: |
# Expect no cache entries
[ ! -d "/tmp/turbo-cache/ci" ] || exit 1
pnpm turbo turbo:test > /tmp/turbo-output
# Expect a single cache entry
[ $(find /tmp/turbo-cache/ci -type f | wc -l) -eq 1 ] || exit 1
- name: Rerun turbo:test with turbo and expect cache to be used
run: |
pnpm turbo turbo:test > /tmp/turbo-output
grep "Remote caching enabled" /tmp/turbo-output > /dev/null
grep "1 cached, 1 total" /tmp/turbo-output > /dev/null
grep "FULL TURBO" /tmp/turbo-output > /dev/null
# Expect there to still just be one cache entry stored
[ $(find /tmp/turbo-cache/ci -type f | wc -l) -eq 1 ] || exit 1
test-invalid-config:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
- name: Run TurboRepo Remote Cache Server with invalid storage provider
uses: ./
id: run-turbo
continue-on-error: true
with:
storage-provider: asdf
storage-path: asdf
- name: Error if prior step succeeded
if: steps.run-turbo.outcome == 'success'
run: exit 1