-
Notifications
You must be signed in to change notification settings - Fork 21
68 lines (59 loc) · 2.18 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
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: setup ENV variables
id: setup-env-vars
shell: bash
run: |
echo "CYPRESS_CACHE_FOLDER=$CYPRESS_CACHE_FOLDER" >> $GITHUB_OUTPUT
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: setup pnpm cache
id: pnpm-cache
uses: actions/cache@v3
with:
path: |
${{ steps.setup-env-vars.outputs.PNPM_STORE_PATH }}
${{ steps.setup-env-vars.outputs.CYPRESS_CACHE_FOLDER }}
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: 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 }}