-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (43 loc) · 1.45 KB
/
protect-stable.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
# This workflow will run tests using node whenever a commit is pushed to develop or main
# For more information see: https://docs.github.com/en/actions/using-workflows/about-workflows
name: CI
on:
push:
# List all branches that shall be tested and are not protected by requiring pull requests to commit to.
branches:
- 'develop'
- 'main'
jobs:
protect:
name: Protect stable
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install YARN dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: lint
run: yarn lint
- name: test
run: yarn test:ci
- name: build
run: yarn build
- name: E2E tests
run: yarn test:e2e