forked from redwoodjs/graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (125 loc) · 5 KB
/
smoke-test.yaml
File metadata and controls
152 lines (125 loc) · 5 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Smoke test, CLI Checks and Telemetry Benchmarks
on:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore: ['docs/**']
jobs:
smoke-test:
if: github.repository == 'redwoodjs/redwood'
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
node-version: ['14', '16']
fail-fast: true
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} | Node ${{ matrix.node-version }} latest
env:
REDWOOD_CI: 1
REDWOOD_VERBOSE_TELEMETRY: 1
PLAYWRIGHT_BROWSERS_PATH: 0 # this makes sure that playwright dependencies are cached in node_modules
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- name: Cache yarn
uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-1234-${{ hashFiles('yarn.lock') }} #change yarn-{randomString} to bust the cache
restore-keys: |
yarn-1234
- name: Install framework dependencies
run: |
yarn install --immutable
- name: Setup test project
id: setup_test_project
uses: ./.github/actions/setup_test_project
env:
REDWOOD_DISABLE_TELEMETRY: 1
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Install Playwright deps
run: npx playwright install --with-deps chromium
- name: Run `rw build` without prerender
run: |
yarn rw build --no-prerender
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run smoke tests on 'rw dev' and 'rw serve'
working-directory: ./tasks/smoke-test
run: npx playwright test
env:
PROJECT_PATH: ${{ steps.setup_test_project.outputs.test_project_path }}
REDWOOD_DISABLE_TELEMETRY: 1
- name: Run `rw info`
run: |
yarn rw info
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run `rw prerender`
run: |
yarn rw prerender --verbose
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run `rw lint`
run: |
yarn rw lint ./api/src --fix
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw test api"
run: |
yarn rw test api --no-watch
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw test web"
run: |
yarn rw test web --no-watch
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw type-check"
run: |
yarn rw type-check
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw check"
run: |
yarn rw check
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw storybook"
run: |
yarn rw sb --smoke-test
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw exec"
run: |
yarn rw g script testScript && yarn rw exec testScript
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "prisma generate"
run: |
yarn rw prisma generate
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "rw data-migrate"
run: |
yarn rw dataMigrate up
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "data-migrate install"
run: |
yarn rw data-migrate install
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "prisma migrate"
run: |
yarn rw prisma migrate dev --name ci-test
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run `rw deploy --help`
run: yarn rw setup deploy --help && yarn rw deploy --help
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run `rw setup ui --help`
run: yarn rw setup --help && yarn rw setup ui --help
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Run "g page"
run: |
yarn rw g page ciTest
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
- name: Throw Error | Run `rw g sdl <model>`
run: |
yarn rw g sdl DoesNotExist
working-directory: ${{ steps.setup_test_project.outputs.test_project_path }}
continue-on-error: true