Repository navigation
81 lines (77 loc) · 3 KB
/
Copy pathcache-warm.yml
File metadata and controls
81 lines (77 loc) · 3 KB
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: cache-warm
# Pull requests can restore caches saved on the default branch, but never caches
# saved by another pull request. Populate every CI cache from master so a new PR
# does not rebuild toolchains, dependencies and Go packages from scratch.
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cache-warm
cancel-in-progress: true
jobs:
warm:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Check out the repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: true
cache-dependency-path: go.sum
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: web/package-lock.json
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Cache the repository Node.js toolchain
uses: actions/cache@v5
with:
path: .cache/tools/node-v24.22.1-linux-x64
key: retrom-node-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.node-version', 'scripts/prepare-node.sh') }}
- name: Prepare native PostgreSQL build prerequisites
run: sudo apt-get update && sudo apt-get install -y bison flex zlib1g-dev
- name: Cache native PostgreSQL tools
uses: actions/cache@v5
with:
path: .cache/tools/postgresql-18.3
key: retrom-postgresql-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('scripts/prepare-postgres.sh') }}
- name: Cache materialized runtime dependencies
uses: actions/cache@v5
with:
path: |
data/runtime
data/dat/emulatorjs/*/fbneo
data/dat/emulatorjs/*/mame2003
data/dat/emulatorjs/*/mame2003_plus
data/dat/emulatorjs/*/fbalpha2012_cps1
data/dat/emulatorjs/*/fbalpha2012_cps2
data/auth/password-blocklists/*/payload
key: retrom-dependencies-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('data/dat/**', 'data/auth/**', 'scripts/dependencies.py', 'scripts/fbalpha2012_dat.py', 'scripts/fbalpha2012-dat-enumerator.cpp') }}
- name: Build the cached toolchains and dependencies
run: |
make prepare-node
scripts/prepare-postgres.sh
make prepare-deps
- name: Cache verified Provider chunks
uses: actions/cache@v5
with:
path: .cache/runtime-providers
key: retrom-provider-chunks-${{ runner.os }}-${{ hashFiles('data/runtime-inputs.json') }}
restore-keys: retrom-provider-chunks-${{ runner.os }}-
- name: Fill the npm and Go module and build caches
run: |
make build web-install
go test -run '^$' ./...
- name: Fill the Provider chunk cache from the pinned release
run: python3 scripts/prepare_image_inputs.py