Skip to content

Commit 0cc4811

Browse files
authored
Merge pull request #153 from researchgate/github/setup-workflows
Move from Travis CI to Github Actions + master to main
2 parents 13a14b7 + 9bad630 commit 0cc4811

File tree

4 files changed

+152
-76
lines changed

4 files changed

+152
-76
lines changed

.github/workflows/build.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
NODE_VERSION: 14
11+
12+
jobs:
13+
tests:
14+
name: Unit tests
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ env.NODE_VERSION }}
25+
26+
- name: Cache node_modules
27+
uses: actions/cache@v2
28+
id: cache-nodemodules
29+
with:
30+
path: node_modules
31+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
32+
33+
- name: Install dependencies
34+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
35+
run: yarn install --frozen-lockfile --non-interactive
36+
37+
- name: Unit tests
38+
run: yarn test --ci --coverage
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/codecov-action@v1
42+
with:
43+
files: ./src/coverage/coverage-final.json
44+
fail_ci_if_error: true
45+
46+
lint:
47+
name: Lint
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v2
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@v2
56+
with:
57+
node-version: ${{ env.NODE_VERSION }}
58+
59+
- name: Cache node_modules
60+
uses: actions/cache@v2
61+
id: cache-nodemodules
62+
with:
63+
path: node_modules
64+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
65+
66+
- name: Install dependencies
67+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
68+
run: yarn install --frozen-lockfile --non-interactive
69+
70+
- name: Lint
71+
run: yarn lint
72+
73+
docs:
74+
needs: [tests, lint]
75+
if: github.ref == 'refs/heads/main'
76+
name: Update docs
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v2
82+
83+
- name: Setup Node.js
84+
uses: actions/setup-node@v2
85+
with:
86+
node-version: ${{ env.NODE_VERSION }}
87+
88+
- name: Cache node_modules
89+
uses: actions/cache@v2
90+
id: cache-nodemodules
91+
with:
92+
path: node_modules
93+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
94+
95+
- name: Install dependencies
96+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
97+
run: yarn install --frozen-lockfile --non-interactive
98+
99+
- name: Build latest app
100+
run: yarn build
101+
102+
- name: Generate storybook documentation
103+
run: yarn build:storybook
104+
105+
- name: Deploy storybook documentation to gh-pages
106+
uses: JamesIves/[email protected]
107+
with:
108+
branch: gh-pages # The branch the action should deploy to.
109+
folder: .docs # The folder the action should deploy.
110+
111+
release:
112+
needs: [tests, lint, docs]
113+
if: github.ref == 'refs/heads/main'
114+
name: Release
115+
runs-on: ubuntu-latest
116+
117+
steps:
118+
- name: Checkout
119+
uses: actions/checkout@v2
120+
with:
121+
fetch-depth: 0
122+
123+
- name: Setup Node.js
124+
uses: actions/setup-node@v2
125+
with:
126+
node-version: ${{ env.NODE_VERSION }}
127+
128+
- name: Cache node_modules
129+
uses: actions/cache@v2
130+
id: cache-nodemodules
131+
with:
132+
path: node_modules
133+
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-nodemodules-${{ hashFiles('**/yarn.lock') }}
134+
135+
- name: Install dependencies
136+
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
137+
run: yarn install --frozen-lockfile --non-interactive
138+
139+
- name: Release
140+
run: yarn release
141+
env:
142+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
143+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
"build:storybook": "build-storybook -o .docs",
9090
"lint": "spire lint",
9191
"prepublishOnly": "yarn build",
92-
"release": "spire release",
92+
"release": "spire release --branches main",
9393
"storybook": "start-storybook -p 9001 -c .storybook",
9494
"test": "spire test",
9595
"ts:check": "tsc --project types"
9696
}
97-
}
97+
}

yarn.lock

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4083,9 +4083,9 @@ can-use-dom@^0.1.0:
40834083
integrity sha1-IsxKNKCrxDlQ9CxkEQJKP2NmtFo=
40844084

40854085
caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30001036, caniuse-lite@^1.0.30001038:
4086-
version "1.0.30001038"
4087-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001038.tgz#44da3cbca2ab6cb6aa83d1be5d324e17f141caff"
4088-
integrity sha512-zii9quPo96XfOiRD4TrfYGs+QsGZpb2cGiMAzPjtf/hpFgB6zCPZgJb7I1+EATeMw/o+lG8FyRAnI+CWStHcaQ==
4086+
version "1.0.30001228"
4087+
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz"
4088+
integrity sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==
40894089

40904090
capture-exit@^2.0.0:
40914091
version "2.0.0"
@@ -5058,7 +5058,7 @@ debug@^3.0.0, debug@^3.1.0, debug@^3.2.5:
50585058
dependencies:
50595059
ms "^2.1.1"
50605060

5061-
debuglog@*, debuglog@^1.0.1:
5061+
debuglog@^1.0.1:
50625062
version "1.0.1"
50635063
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
50645064
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -7534,7 +7534,7 @@ import-local@^3.0.2:
75347534
pkg-dir "^4.2.0"
75357535
resolve-cwd "^3.0.0"
75367536

7537-
imurmurhash@*, imurmurhash@^0.1.4:
7537+
imurmurhash@^0.1.4:
75387538
version "0.1.4"
75397539
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
75407540
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -9327,11 +9327,6 @@ lockfile@^1.0.4:
93279327
dependencies:
93289328
signal-exit "^3.0.2"
93299329

9330-
lodash._baseindexof@*:
9331-
version "3.1.0"
9332-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
9333-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
9334-
93359330
lodash._baseisequal@^3.0.0:
93369331
version "3.0.7"
93379332
resolved "https://registry.yarnpkg.com/lodash._baseisequal/-/lodash._baseisequal-3.0.7.tgz#d8025f76339d29342767dcc887ce5cb95a5b51f1"
@@ -9349,29 +9344,17 @@ lodash._baseuniq@~4.6.0:
93499344
lodash._createset "~4.0.0"
93509345
lodash._root "~3.0.0"
93519346

9352-
lodash._bindcallback@*, lodash._bindcallback@^3.0.0:
9347+
lodash._bindcallback@^3.0.0:
93539348
version "3.0.1"
93549349
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
93559350
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
93569351

9357-
lodash._cacheindexof@*:
9358-
version "3.0.2"
9359-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
9360-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
9361-
9362-
lodash._createcache@*:
9363-
version "3.1.2"
9364-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
9365-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
9366-
dependencies:
9367-
lodash._getnative "^3.0.0"
9368-
93699352
lodash._createset@~4.0.0:
93709353
version "4.0.3"
93719354
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
93729355
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
93739356

9374-
lodash._getnative@*, lodash._getnative@^3.0.0:
9357+
lodash._getnative@^3.0.0:
93759358
version "3.9.1"
93769359
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
93779360
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
@@ -9468,11 +9451,6 @@ lodash.memoize@^4.1.2:
94689451
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
94699452
integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=
94709453

9471-
lodash.restparam@*:
9472-
version "3.6.1"
9473-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
9474-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
9475-
94769454
lodash.sortby@^4.7.0:
94779455
version "4.7.0"
94789456
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
@@ -10451,7 +10429,6 @@ npm@^6.14.8:
1045110429
cmd-shim "^3.0.3"
1045210430
columnify "~1.5.4"
1045310431
config-chain "^1.1.12"
10454-
debuglog "*"
1045510432
detect-indent "~5.0.0"
1045610433
detect-newline "^2.1.0"
1045710434
dezalgo "~1.0.3"
@@ -10466,7 +10443,6 @@ npm@^6.14.8:
1046610443
has-unicode "~2.0.1"
1046710444
hosted-git-info "^2.8.8"
1046810445
iferr "^1.0.2"
10469-
imurmurhash "*"
1047010446
infer-owner "^1.0.4"
1047110447
inflight "~1.0.6"
1047210448
inherits "^2.0.4"
@@ -10485,14 +10461,8 @@ npm@^6.14.8:
1048510461
libnpx "^10.2.4"
1048610462
lock-verify "^2.1.0"
1048710463
lockfile "^1.0.4"
10488-
lodash._baseindexof "*"
1048910464
lodash._baseuniq "~4.6.0"
10490-
lodash._bindcallback "*"
10491-
lodash._cacheindexof "*"
10492-
lodash._createcache "*"
10493-
lodash._getnative "*"
1049410465
lodash.clonedeep "~4.5.0"
10495-
lodash.restparam "*"
1049610466
lodash.union "~4.6.0"
1049710467
lodash.uniq "~4.5.0"
1049810468
lodash.without "~4.4.0"

0 commit comments

Comments
 (0)