-
Notifications
You must be signed in to change notification settings - Fork 693
86 lines (72 loc) · 2.52 KB
/
create-spectacle.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
82
83
84
85
86
name: create-spectacle
env:
PNPM_STORE_PATH: ''
on:
push:
branches:
- main
paths:
- '.github/workflows/create-spectacle.yml'
- 'packages/create-spectacle/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/create-spectacle.yml'
- 'packages/create-spectacle/**'
jobs:
build:
name: Create, build, and install
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
create-type: ['tsx', 'onepage']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
run_install: false
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Copy Spectacle package
run: pnpm run --filter ./packages/create-spectacle copy-spectacle-package
- name: Build create-spectacle
run: pnpm run --filter ./packages/create-spectacle build
# Create, build, isntall a full example.
# Then, start a background dev server.
- name: Create example - ${{ matrix.create-type }}
working-directory: ./packages/create-spectacle
run: pnpm run examples:${{ matrix.create-type }}:create
- name: Install example - ${{ matrix.create-type }}
working-directory: ./packages/create-spectacle
run: pnpm run examples:${{ matrix.create-type }}:install
- name: Build example - ${{ matrix.create-type }}
working-directory: ./packages/create-spectacle
run: pnpm run examples:${{ matrix.create-type }}:build
# Wait until the dev server is full up and running and then test.
- name: Start and test example - ${{ matrix.create-type }}
working-directory: ./packages/create-spectacle
run: |
pnpm run examples:${{ matrix.create-type }}:start & \
pnpm exec wait-on http-get://localhost:3000 && \
pnpm run examples:test