Skip to content

Commit 1d4ce19

Browse files
committed
chore: first pass at running tests in github actions
1 parent a43a7c7 commit 1d4ce19

File tree

16 files changed

+349
-362
lines changed

16 files changed

+349
-362
lines changed

.circleci/config.yml

Lines changed: 6 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ commands:
2222
downstream:
2323
steps:
2424
- checkout
25-
# - restore_cache:
26-
# keys:
27-
# - v4c-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
28-
# - restore_cache:
29-
# keys:
30-
# - v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-{{ checksum "package.json" }}-
25+
- restore_cache:
26+
keys:
27+
- v4c-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
28+
- restore_cache:
29+
keys:
30+
- v4b-<< pipeline.parameters.wireit_cache_name >>-{{ arch }}-{{ checksum "package.json" }}-
3131
- run:
3232
name: Installing Dependencies
3333
command: |
@@ -143,58 +143,6 @@ commands:
143143
key: v2-golden-images-{{ .Branch }}-<< parameters.regression_system >>-<< parameters.regression_color >>-<< parameters.regression_scale >>-<< parameters.regression_dir >>-{{ epoch }}
144144

145145
jobs:
146-
test-chromium:
147-
executor: node
148-
149-
steps:
150-
- downstream
151-
- run:
152-
name: Run unit tests
153-
command: yarn test:ci --config web-test-runner.config.ci-chromium.js --group no-memory-ci --coverage
154-
- store_test_results:
155-
path: /root/project/results/
156-
- store_artifacts:
157-
path: coverage
158-
159-
test-chromium-memory:
160-
executor: node
161-
162-
steps:
163-
- downstream
164-
- run:
165-
name: Run memory tests
166-
command: yarn test:ci --config web-test-runner.config.ci-chromium.js --group memory-ci
167-
- store_test_results:
168-
path: /root/project/results/
169-
170-
test-firefox:
171-
executor: node
172-
parallelism: 5
173-
174-
steps:
175-
- downstream
176-
- run:
177-
name: Run tests
178-
command: |
179-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
180-
yarn test:start --files $TEST --config web-test-runner.config.ci-firefox.js --group unit-ci
181-
- store_test_results:
182-
path: /root/project/results/
183-
184-
test-webkit:
185-
executor: node
186-
parallelism: 5
187-
188-
steps:
189-
- downstream
190-
- run:
191-
name: Run tests
192-
command: |
193-
TEST=$(circleci tests glob packages/*/test/*.test.js | circleci tests split --split-by=timings)
194-
yarn test:start --files $TEST --config web-test-runner.config.ci-webkit.js --group unit-ci
195-
- store_test_results:
196-
path: /root/project/results/
197-
198146
preview-docs:
199147
executor: node
200148
steps:
@@ -217,29 +165,6 @@ jobs:
217165
branch=$(npx slugify-cli $branch)
218166
yarn netlify deploy --alias=$branch --cwd projects/documentation
219167
220-
beta-docs:
221-
executor: node
222-
223-
steps:
224-
- downstream
225-
- run:
226-
name: Generate Custom Elements Manifest
227-
command: yarn docs:analyze
228-
- run:
229-
name: Move CEM to Storybook directory
230-
command: cp projects/documentation/custom-elements.json storybook/
231-
- run:
232-
name: Build documentation
233-
command: yarn docs:build
234-
- run:
235-
name: Build Storybook
236-
command: yarn storybook:build
237-
- run: echo '/* /index.html 200' > projects/documentation/dist/_redirects
238-
- run: |
239-
branch=$(git symbolic-ref --short HEAD)
240-
branch=$(npx slugify-cli $branch)
241-
yarn netlify deploy --alias=beta --cwd projects/documentation
242-
243168
hcm-visual:
244169
executor: node
245170

@@ -349,10 +274,6 @@ workflows:
349274
version: 2
350275
build:
351276
jobs:
352-
- test-chromium
353-
- test-chromium-memory
354-
- test-firefox
355-
- test-webkit
356277
- hcm-visual:
357278
filters:
358279
branches:
@@ -363,11 +284,6 @@ workflows:
363284
branches:
364285
# Forked pull requests have CIRCLE_BRANCH set to pull/XXX
365286
ignore: /pull\/[0-9]+/
366-
- beta-docs:
367-
filters:
368-
branches:
369-
# Beta docs are only published from main
370-
only: main
371287
- visual:
372288
name: << matrix.system >>-<< matrix.color >>-<< matrix.scale >>-<< matrix.dir >>
373289
matrix:

.github/actions/setup-job/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ inputs:
55
description: 'The Node.js version to use'
66
required: false
77
default: '20'
8+
skip-build:
9+
description: 'Skip the build step'
10+
required: false
11+
default: 'false'
12+
with-playwright:
13+
description: 'Whether to install Playwright'
14+
required: false
15+
default: 'false'
16+
browser:
17+
description: 'The browser to use'
18+
required: false
819
runs:
920
using: 'composite'
1021
steps:
@@ -35,6 +46,29 @@ runs:
3546
shell: bash
3647
run: yarn install --immutable
3748

49+
- name: Get installed Playwright version
50+
if: ${{ inputs.with-playwright == 'true' }}
51+
id: playwright-version
52+
shell: bash
53+
run: echo "version=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
54+
55+
- name: Restore Playwright cache
56+
continue-on-error: true
57+
if: ${{ inputs.with-playwright == 'true' }}
58+
id: playwright-cache
59+
uses: actions/cache@v4
60+
with:
61+
path: ~/.cache/ms-playwright
62+
key: ${{ runner.os }}-playwright-${{ inputs.browser }}-${{ steps.playwright-version.outputs.version }}
63+
restore-keys: |
64+
${{ runner.os }}-playwright-${{ inputs.browser }}-
65+
66+
- name: Install Playwright
67+
if: ${{ inputs.with-playwright == 'true' && steps.playwright-cache.outputs.cache-hit != 'true' }}
68+
shell: bash
69+
run: yarn playwright install --with-deps ${{ inputs.browser }}
70+
3871
- name: Build the project
72+
if: ${{ inputs.skip-build != 'true' }}
3973
shell: bash
4074
run: yarn build

.github/workflows/browser-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Browser Performance Tests
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
workflow_dispatch:
5+
workflow_call:
66

77
permissions:
88
contents: read
@@ -31,8 +31,7 @@ jobs:
3131
fetch-depth: 0 # Get full history
3232

3333
- name: Fetch main branch
34-
run: |
35-
git fetch origin main:main
34+
run: git fetch origin main:main
3635

3736
- name: Setup Job and Install Dependencies
3837
uses: ./.github/actions/setup-job
@@ -41,7 +40,7 @@ jobs:
4140
if: matrix.browser == 'chrome'
4241
run: |
4342
echo "Checking ChromeDriver version..."
44-
npx chromedriver --version
43+
yarn dlx chromedriver --version
4544
echo "Checking Chrome version..."
4645
google-chrome --version
4746
echo "Checking tachometer chromedriver version..."
@@ -83,6 +82,8 @@ jobs:
8382

8483
- name: Setup Job and Install Dependencies
8584
uses: ./.github/actions/setup-job
85+
with:
86+
skip-build: true
8687

8788
- uses: actions/download-artifact@v4
8889
with:

.github/workflows/build.yml

Lines changed: 6 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,31 @@
1-
name: Build
2-
#
3-
# This workflow validates that the commit in question can be built successfully
4-
# in several environments:
5-
#
6-
# Systems: Ubuntu, MacOS, Windows (default: macos-latest)
7-
# Node versions: 20 (default)
8-
# Experimental: true/false (default: false)
9-
# Ref: The branch or tag to checkout (default: github.head_ref)
10-
#
11-
1+
name: Build validation
122
on:
133
workflow_dispatch:
14-
inputs:
15-
system:
16-
required: false
17-
default: 'macos-latest'
18-
node-version:
19-
required: false
20-
default: '20'
21-
experimental:
22-
required: false
23-
default: 'false'
24-
ref:
25-
description: 'The branch or tag to checkout'
26-
required: false
274
workflow_call:
28-
inputs:
29-
system:
30-
required: false
31-
type: string
32-
default: 'macos-latest'
33-
node-version:
34-
required: false
35-
type: string
36-
default: '20'
37-
experimental:
38-
required: false
39-
type: boolean
40-
default: false
41-
ref:
42-
description: 'The branch or tag to checkout'
43-
required: false
44-
type: string
45-
default: ${{ github.head_ref }}
46-
47-
permissions:
48-
contents: read
49-
pull-requests: write
50-
51-
defaults:
52-
run:
53-
shell: bash
545

556
jobs:
56-
# ---------- Validate build for various environments ---------- #
577
build:
8+
name: Build ${{ matrix.system }}, node v${{ matrix.node-version }}
589
strategy:
5910
fail-fast: false
6011
matrix:
6112
system:
62-
- ${{ inputs.system }}
13+
- macos-latest
14+
- ubuntu-latest
15+
# - windows-latest
6316
node-version:
64-
- ${{ inputs.node-version }}
65-
experimental:
66-
- ${{ inputs.experimental }}
17+
- 20
6718
runs-on: ${{ matrix.system }}
68-
continue-on-error: ${{ matrix.experimental }}
6919
timeout-minutes: 10
70-
name: Build ${{ matrix.system }}, node v${{ matrix.node-version }}
7120
steps:
7221
- name: Checkout PR branch
7322
uses: actions/checkout@v4
74-
with:
75-
ref: ${{ inputs.ref || github.head_ref }}
76-
fetch-depth: 0
7723

7824
- name: Setup Job and Install Dependencies
7925
uses: ./.github/actions/setup-job
8026
with:
8127
node-version: ${{ matrix.node-version }}
8228

83-
- name: Build the project
84-
run: yarn build
85-
8629
# This step will evaluate the repo status and report the change
8730
# If there are changes, capture the changes and upload them as an artifact
8831
- name: Check if there are changes

.github/workflows/coveralls.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)