Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Commit 23c49e2

Browse files
committed
ci(actions): add workflow for building, testing, and releasing
1 parent c26cd76 commit 23c49e2

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

.github/workflows/build.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
3+
name: Build
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
- next
11+
- alpha
12+
- beta
13+
14+
jobs:
15+
deduplicate:
16+
name: Deduplicate Jobs
17+
runs-on: ubuntu-latest
18+
outputs:
19+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
20+
steps:
21+
- id: skip_check
22+
uses: fkirc/skip-duplicate-actions@master
23+
with:
24+
concurrent_skipping: same_content_newer
25+
26+
build:
27+
name: Build + Test + Release / Node ${{ matrix.node }}
28+
runs-on: ubuntu-latest
29+
if: ${{ needs.deduplicate.outputs.should_skip != 'true' }}
30+
strategy:
31+
matrix:
32+
node: ['12', '14', '16']
33+
playwright: ['1.1.0', 'latest']
34+
35+
steps:
36+
- name: Get Yarn cache path
37+
id: yarn-cache
38+
run: echo "::set-output name=dir::$(yarn cache dir)"
39+
40+
- name: Checkout
41+
uses: actions/checkout@master
42+
43+
- name: Setup node
44+
uses: actions/setup-node@master
45+
with:
46+
node-version: ${{ matrix.node }}
47+
48+
- name: Load Yarn cache
49+
uses: actions/cache@v2
50+
with:
51+
path: ${{ steps.yarn-cache.outputs.dir }}
52+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
53+
restore-keys: ${{ runner.os }}-yarn-
54+
55+
- name: Install dependencies
56+
run: yarn install --frozen-lockfile
57+
58+
- name: Install specific Playwright version
59+
run: |
60+
yarn add -D ${{ matrix.playwright }}
61+
yarn why playwright
62+
63+
- name: Build
64+
run: yarn rebuild
65+
66+
- name: Run lint + tests
67+
run: yarn validate
68+
69+
- name: Upload Coverage / Release
70+
run: yarn ci-after-success
71+
if: ${{ matrix.node == '14' }}
72+
env:
73+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
74+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)