-
Notifications
You must be signed in to change notification settings - Fork 16
106 lines (86 loc) · 2.77 KB
/
develop.yml
File metadata and controls
106 lines (86 loc) · 2.77 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Develop
on:
push:
branches:
- develop
jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [13]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Restore Lerna node modules
uses: actions/cache@master
if: matrix.os != 'windows-latest' # Only run coverage on ubuntu
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Packages
run: yarn install --frozen-lock-file
- name: Lint
run: yarn lint
- name: Test
run: yarn coverage
- name: Coverage
if: matrix.os == 'ubuntu-latest' # Only run coverage on ubuntu
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
file: ./packages/api/coverage/lcov.info # optional
flags: unittests # optional
fail_ci_if_error: true # optional (default = false)
publish:
name: Publish - patch v
runs-on: ubuntu-latest
needs: build
steps:
- name: checkout
uses: actions/checkout@v2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: checkout
uses: actions/checkout@v2
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: Configure CI Git User
run: |
git config --global user.name '@tristanMatthias'
git config --global user.email 'tristanMatthias@users.noreply.github.com'
git remote set-url origin https://$GITHUB_ACTOR:$ACCESS_TOKEN@github.com/code-mentoring/learn
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: restore lerna
uses: actions/cache@master
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Packages
run: yarn install --frozen-lock-file
- name: Authenticate with Registry
run: |
yarn logout
echo "registry=http://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm whoami
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish packages
run: yarn publish:ci develop
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }} # Needed for semantic release
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}