Skip to content

Commit c42360c

Browse files
committed
ci(gh): adds github actions
re #175
1 parent f0c5d8d commit c42360c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/build.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Node.js CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: [ubuntu-latest]
8+
9+
strategy:
10+
matrix:
11+
# Maintenance versions of node
12+
node-version: [10.x, 12.x, 14.x]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
# todo - lint commit messages
18+
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
24+
- name: Get yarn cache directory path
25+
id: yarn-cache-dir-path
26+
run: echo "::set-output name=dir::$(yarn cache dir)"
27+
28+
- uses: actions/cache@v2
29+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
30+
with:
31+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
32+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-yarn-
35+
36+
- name: Install dependencies
37+
run: yarn --frozen-lockfile
38+
39+
- run: yarn build --if-present
40+
# todo - make tests
41+
# - run: yarn test:unit
42+
# - run: yarn test:compatability
43+
44+
# todo - deploy in different action?
45+
env:
46+
CI: true

0 commit comments

Comments
 (0)