Skip to content

Commit 9f1d40b

Browse files
ryan-roemerfritz-c
andauthored
Infra: Separate out examples CI steps (#1194)
* Separate out examples CI steps * Hahaha * Combine start and test * Set timeout * chore: fix tsconfig for generated projects * chore: make jest ignore compiled or cached test files * chore: increase jest timeout * chore: comment on timeout-altering line Co-authored-by: fritz-c <[email protected]>
1 parent 0ee44a7 commit 9f1d40b

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.github/workflows/create-spectacle.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ on:
55
branches:
66
- main
77
paths:
8+
- ".github/workflows/create-spectacle.yml"
89
- "packages/create-spectacle/**"
910
pull_request:
1011
branches:
1112
- main
1213
paths:
14+
- ".github/workflows/create-spectacle.yml"
1315
- "packages/create-spectacle/**"
1416

1517
jobs:
1618
build:
1719
name: Create, build, and install
20+
timeout-minutes: 5
1821
runs-on: ubuntu-latest
1922
strategy:
2023
matrix:
@@ -55,15 +58,20 @@ jobs:
5558
# Then, start a background dev server.
5659
- name: Create example - ${{ matrix.create-type }}
5760
working-directory: ./packages/create-spectacle
58-
run: |
59-
pnpm run examples:${{ matrix.create-type }}:create && \
60-
pnpm run examples:${{ matrix.create-type }}:install && \
61-
pnpm run examples:${{ matrix.create-type }}:build && \
62-
pnpm run examples:${{ matrix.create-type }}:start &
61+
run: pnpm run examples:${{ matrix.create-type }}:create
62+
63+
- name: Install example - ${{ matrix.create-type }}
64+
working-directory: ./packages/create-spectacle
65+
run: pnpm run examples:${{ matrix.create-type }}:install
66+
67+
- name: Build example - ${{ matrix.create-type }}
68+
working-directory: ./packages/create-spectacle
69+
run: pnpm run examples:${{ matrix.create-type }}:build
6370

6471
# Wait until the dev server is full up and running and then test.
65-
- name: Test example - ${{ matrix.create-type }}
72+
- name: Start and test example - ${{ matrix.create-type }}
6673
working-directory: ./packages/create-spectacle
6774
run: |
75+
pnpm run examples:${{ matrix.create-type }}:start & \
6876
pnpm exec wait-on http-get://localhost:3000 && \
6977
pnpm run examples:test
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
module.exports = {
2-
preset: 'ts-jest/presets/js-with-ts'
2+
preset: 'ts-jest/presets/js-with-ts',
3+
testPathIgnorePatterns: [
4+
'/node_modules/',
5+
'<rootDir>/bin/',
6+
'<rootDir>/.wireit/'
7+
]
38
};

packages/create-spectacle/src/templates/tsconfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const tsconfigTemplate = () =>
99
"jsx": "react-jsx",
1010
"module": "commonjs",
1111
"moduleResolution": "node",
12+
"allowJs": true,
1213
"allowUmdGlobalAccess": true,
1314
"allowSyntheticDefaultImports": true,
1415
"esModuleInterop": true,

packages/create-spectacle/test/e2e.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import type { Browser, Page } from 'puppeteer';
22
import puppeteer from 'puppeteer';
33
import { getLaunchOptions } from './util';
44

5+
// Make the test timeout longer to accomodate Puppeteer startup
6+
jest.setTimeout(20000);
7+
58
describe('App.js', () => {
69
let browser: Browser;
710
let page: Page;

0 commit comments

Comments
 (0)