Skip to content

Commit ba83219

Browse files
byzykmontogeek
authored andcommitted
infrastructure(site) Add test task and use yarn to TravisCI (#2226)
* re-arrange ci scripts order * add test task to pipeline * npm -> yarn * remove yarn installation * fix: remaining linter issues
1 parent 960a2b2 commit ba83219

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ branches:
55
language: node_js
66
node_js:
77
- "8"
8-
script:
9-
- bash ./src/scripts/deploy.sh
108
sudo: required
119
install:
12-
- npm install --global yarn
1310
- yarn
1411
- sudo pip install proselint
12+
script:
13+
- bash ./src/scripts/deploy.sh

src/content/concepts/mode.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Mode
33
sort: 4
44
contributors:
55
- EugeneHlushko
6+
- byzyk
67
---
78

89
Providing the `mode` configuration option tells webpack to use its built-in optimizations accordingly.
@@ -85,20 +86,20 @@ If you want to change the behavior according the **mode** variable inside the *w
8586

8687
```javascript
8788
var config = {
88-
entry: "./app.js"
89-
..
90-
}
89+
entry: './app.js'
90+
//...
91+
};
9192

9293
module.exports = (env, argv) => {
93-
94-
if (argv.mode === "development") {
95-
config.devtool = "source-map";
94+
95+
if (argv.mode === 'development') {
96+
config.devtool = 'source-map';
9697
}
97-
98-
if (argv.mode === "production") {
98+
99+
if (argv.mode === 'production') {
100+
//...
99101
}
100-
101-
return config;
102-
}
103102

103+
return config;
104+
};
104105
```

src/scripts/deploy.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ SOURCE_BRANCH="master"
77
# Pull requests and commits to other branches shouldn't try to deploy, just build to verify
88
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
99
echo "Skipping deploy; just doing a build and linting links/prose/js."
10-
npm run build
11-
npm test
10+
yarn test
11+
yarn build
1212
exit 0
1313
fi
1414

1515
# Save some useful information
1616
REPO=`git config remote.origin.url`
1717
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
1818

19+
# Run tests
20+
yarn test
21+
1922
# Run our build
20-
npm run build
23+
yarn build
2124

2225
# Set some git options
2326
git config --global user.name "Travis CI"
@@ -35,4 +38,4 @@ eval `ssh-agent -s`
3538
ssh-add src/scripts/deploy_key
3639

3740
# Now that we're all set up, we can deploy
38-
npm run deploy
41+
yarn deploy

0 commit comments

Comments
 (0)