Skip to content

Version Packages (#1305) #84

Version Packages (#1305)

Version Packages (#1305) #84

name: create-spectacle
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@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1
- uses: pnpm/[email protected]
with:
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('./pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- 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