-
Notifications
You must be signed in to change notification settings - Fork 64
50 lines (50 loc) · 1.45 KB
/
main.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
name: Main Workflow
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build:
name: Actions
strategy:
matrix:
node-version: [18]
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node-version }}
options: --user 1001
steps:
- uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory
id: yarn-cache-dir
run: |
echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-modules-
- name: Cache packages
uses: actions/cache@v3
id: cache-packages
with:
path: packages/**
key: ${{ runner.os }}-${{ hashFiles('packages/*') }}
- run: node --version
- run: yarn --immutable
if: steps.cache-node-modules.outputs.cache-hit != 'true'
- run: yarn run format
- run: yarn run lint
- run: yarn run package
if: steps.cache-packages.outputs.cache-hit != 'true'
- run: yarn run test