This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
68 lines (53 loc) · 1.45 KB
/
.travis.yml
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
language: node_js
node_js:
- 10
- 12
cache: yarn
before_install:
- travis_retry yarn global add aegir@20 truffle@4 ganache-cli@6
install:
- travis_retry yarn install
before_script:
# Start Ganache CLI
- ganache-cli | head -42 &
# Deploy smart contract to Ganache CLI
- |
(
git clone https://github.com/gitcoinco/ethavatar.git /tmp/ethavatar
cd /tmp/ethavatar
printf "module.exports = {\nnetworks: {\ndevelopment: {\nhost: \"127.0.0.1\",\nport: 8545,\nnetwork_id: \"*\"\n}\n}\n}" > truffle.js
truffle migrate
)
# Copy smart contract to package
- cp /tmp/ethavatar/build/contracts/EthAvatar.json $TRAVIS_BUILD_DIR/src/data/EthAvatar.json
script:
# Run lint and test
- yarn lint
- yarn test:node
# Display coverage
- yarn coverage 2> /dev/null | sed -n -e '/----------/,$p' | sed \$d
before_deploy:
# Remove smart contract changes
- git checkout -- $TRAVIS_BUILD_DIR/src/data/EthAvatar.json
# Set latest tag as version
- npm version -no-git-tag-version $(git describe --abbrev=0 --tags)
# Make documentation and build code
- yarn docs
- yarn build
# Use custom subdomain for docs
- echo 'ethavatar.js.org' > ./docs/CNAME
deploy:
- provider: pages
skip_cleanup: true
on:
branch: master
node: 12
github_token: $GH_TOKEN
local_dir: docs
- provider: npm
skip_cleanup: true
on:
tags: true
node: 12
email: $NPM_EMAIL
api_key: $NPM_TOKEN