This repository was archived by the owner on May 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
68 lines (61 loc) · 2.27 KB
/
Copy pathbuild-shared-cache.yml
File metadata and controls
68 lines (61 loc) · 2.27 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
name: Build main shared cache
env:
SNAPLET_TARGET_DATABASE_URL: 'postgresql://postgres:postgres@localhost/snaplet_development'
DATABASE_URL: 'postgresql://postgres:postgres@localhost/snaplet_development'
on:
workflow_dispatch:
concurrency:
group: build-shared-cache-main
cancel-in-progress: true
# Build a shared cache for the dependencies to be shared between our PR and workflows
jobs:
build-shared-deps-cache:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/install
build-shared-tests-cache:
needs: build-shared-deps-cache
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/tests/install
# Build and cache snaplet binary
- uses: ./.github/actions/tests/build-cli
with:
lookup-only: true
# Install and cache playwright install for e2e web
- uses: ./.github/actions/tests/install-playwright
with:
lookup-only: true
# Cache our latests success snapshot to avoid re-download in between PR and workflow
build-shared-snapshot-cache:
needs: build-shared-deps-cache
runs-on: ubuntu-latest
# Right now there is no way to download our snapshot without having to restore it, so sadly we need a database
services:
postgres:
image: postgres:13
credentials:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-node
- uses: ./.github/actions/install
# TODO: add a way to download the snapshot without the need to restore it
- uses: ./.github/actions/tests/restore-latest-snapshot
with:
snaplet-access-token: ${{ secrets.SNAPLET_ACCESS_TOKEN }}
database-url: postgresql://postgres:postgres@localhost/snaplet_development