forked from mdx-js/mdx
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.56 KB
/
ci.yml
File metadata and controls
57 lines (47 loc) · 1.56 KB
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
name: CI
on: [push, pull_request]
jobs:
default:
name: Build and Test on ${{ matrix.os }} with Node.js ${{ matrix.node }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
node: [10, 12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Setup yarn
if: matrix.os != 'windows-latest'
run: |
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$PATH"
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node }}-yarn-
- name: Install Dependencies
run: yarn --frozen-lockfile
env:
CI: 'true'
- name: Build and Lint
if: matrix.os != 'windows-latest'
run: |
yarn build
yarn lint
- name: Test
run: yarn test
- name: Publish CI tag to npm
if: matrix.node == 12 && matrix.os == 'macOS-latest' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
npm set //registry.npmjs.org/:_authToken $NPM_AUTH_TOKEN
yarn publish-ci
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}