-
Notifications
You must be signed in to change notification settings - Fork 21
76 lines (66 loc) · 2.29 KB
/
build.yml
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
name: Check branch is releasable and release alpha on main branch update
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-16.18.1-chrome-110.0.5481.96-1-ff-109.0-edge-110.0.1587.41-1
# https://github.com/cypress-io/github-action#firefox Cypress FF image needs this user permissions to be able to install dependencies
options: --user 1001
steps:
- name: checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
# Install pnpm because it is not included in our container image
- name: install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: save pnpm store directory
id: pnpm-store-directory
shell: bash
run: |
echo "PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: setup pnpm cache
id: pnpm-cache
uses: actions/cache@v3
with:
path: |
${{ steps.pnpm-store-directory.outputs.PATH }}
~/.cache/Cypress
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: setup eslint cache
uses: actions/cache@v3
with:
path: '**/.eslintcache'
key: eslint-${{github.sha}}
restore-keys: eslint-
- name: setup lerna cache
id: lerna-cache
uses: actions/cache@v3
with:
path: |
node_modules/.cache
key: lerna-cache-${{github.sha}}
restore-keys: lerna-cache-
- name: install dependencies
run: pnpm install
- name: lint packages
run: pnpm run lint
- name: test packages
run: pnpm run test
- name: release alpha on non-release pushes to main branch
if:
${{ github.ref_name == 'main' && github.actor != 'support-empathy' &&
!startsWith(github.event.head_commit.message, 'chore(release):') }}
uses: ./.github/actions/release-alpha
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.SUPPORT_TOKEN }}