-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (73 loc) · 2.47 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
name: test
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
group: [1, 2]
name: parallel group ${{ matrix.group }}/2
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: "Runtime cache: restore"
uses: actions/cache/restore@v4
id: cache-restore
with:
key: runtime-cache-all
path: tmp/parallel_runtime_test.log
- name: rake test # change to `--group-by filesize` when this runtime is missing or bad
run: bundle exec parallel_test -n 2 --group-by runtime --only-group ${{ matrix.group }} --verbose
env:
RECORD_RUNTIME: "true"
- name: "Runtime cache: clear previous chunk cache"
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete runtime-cache-${{ matrix.group }} --confirm
continue-on-error: true # do not fail in case the key was deleted by a parallel run
- name: "Runtime cache: prepare chunk"
shell: bash
run: |
mkdir -p tmp/parallel_runtime_test
mv tmp/parallel_runtime_test.log tmp/parallel_runtime_test/${{ matrix.group }}.log
- name: "Runtime cache: store chunk"
uses: actions/cache/save@v4
with:
key: runtime-cache-${{ matrix.group }}
path: tmp/parallel_runtime_test
store-runtime:
runs-on: ubuntu-latest
needs: test
steps:
- name: "Runtime cache: load chunk 1"
uses: actions/cache/restore@v4
with:
key: runtime-cache-1
path: tmp/parallel_runtime_test
- name: "Runtime cache: load chunk 2"
uses: actions/cache/restore@v4
with:
key: runtime-cache-2
path: tmp/parallel_runtime_test
- name: "Runtime cache: combine chunks"
run: |
cat tmp/parallel_runtime_test/* > tmp/parallel_runtime_test.log
cat tmp/parallel_runtime_test.log
- name: "Runtime cache: clear"
env:
GH_TOKEN: ${{ github.token }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete runtime-cache-all --confirm
continue-on-error: true # do not fail in case the key was deleted by a parallel run
- name: "Runtime cache: store"
uses: actions/cache/save@v4
with:
key: runtime-cache-all
path: tmp/parallel_runtime_test.log