-
Notifications
You must be signed in to change notification settings - Fork 10
77 lines (65 loc) · 2.25 KB
/
ci.yml
File metadata and controls
77 lines (65 loc) · 2.25 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
name: "CI"
on:
workflow_call:
inputs:
image-tag-override: # example: latest, 7037e37a18a379d583164441baff9e594cc479f8
type: string # use this to force a container version.
workflow_dispatch:
env:
CI: true
AWS_REGION: us-east-1
ECR_REPOSITORY_PREFIX: pubpub-v7
CONTAINER_NAME: core
jobs:
ci:
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
task:
- lint:ci
- type-check
- test-run
env:
COMPOSE_FILE: docker-compose.test.yml
ENV_FILE: .env.docker-compose.dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.13.1
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- name: Get pnpm store directory
id: get-store-path
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
# to cache p:build, format, lint, type-check and test-run
- name: Setup turbo cache
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: p:build
run: pnpm p:build
- name: Setup test dependencies
if: matrix.task == 'test-run'
run: pnpm test:setup
- name: Run task
run: NODE_ENV=test pnpm ${{ matrix.task }}