Skip to content

Commit 594756a

Browse files
committed
Replace travis with GitHub Actions
- add coverage reporters path
1 parent a42cf5a commit 594756a

File tree

4 files changed

+72
-14
lines changed

4 files changed

+72
-14
lines changed

.github/workflows/main.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches: ['*']
11+
12+
workflow_dispatch:
13+
14+
jobs:
15+
main:
16+
name: Validate and Deploy
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
CI: true
21+
22+
steps:
23+
- name: Setup timezone
24+
uses: zcong1993/setup-timezone@master
25+
with:
26+
timezone: America/Sao_Paulo
27+
28+
- name: Setup repo
29+
uses: actions/checkout@v2
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v1
33+
with:
34+
node-version: '14.x'
35+
registry-url: 'https://registry.npmjs.org'
36+
37+
- name: Cache Packages
38+
id: cache
39+
uses: actions/cache@v2
40+
with:
41+
path: ~/.npm
42+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
43+
restore-keys: |
44+
${{ runner.os }}-node-
45+
timeout-minutes: 1
46+
47+
- name: Install Packages
48+
run: npm ci
49+
timeout-minutes: 3
50+
51+
- name: Validate
52+
if: "!startsWith(github.ref, 'refs/tags/')"
53+
run: npm run validate
54+
timeout-minutes: 3
55+
56+
- name: Publish code coverage
57+
if: "!startsWith(github.ref, 'refs/tags/')"
58+
uses: paambaati/codeclimate-action@v3.0.0
59+
env:
60+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
61+
with:
62+
coverageLocations: |
63+
${{github.workspace}}/packages/tree-changes/coverage/lcov.info:lcov
64+
${{github.workspace}}/packages/tree-changes-hook/coverage/lcov.info:lcov
65+
66+
- name: Publish Packages
67+
if: startsWith(github.ref, 'refs/tags/')
68+
run: lerna publish from-git
69+
env:
70+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/tree-changes-hook/jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
statements: 90,
1010
},
1111
},
12+
coverageReporters: [['lcov', { projectRoot: '../..' }]],
1213
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
1314
moduleDirectories: ['node_modules', 'src', './'],
1415
preset: 'ts-jest',

packages/tree-changes/jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
statements: 90,
1010
},
1111
},
12+
coverageReporters: [['lcov', { projectRoot: '../..' }]],
1213
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
1314
moduleDirectories: ['node_modules', 'src', './'],
1415
preset: 'ts-jest',

0 commit comments

Comments
 (0)