Skip to content

Commit 8f1c02f

Browse files
committed
Add CI artifacts.
1 parent aa0fb64 commit 8f1c02f

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
cache: yarn
16+
- run: yarn install
17+
- run: yarn build
18+
- run: yarn test
19+
- run: yarn run check-git-clean

check-git-clean.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash -e
2+
3+
if ! git diff --quiet; then echo "
4+
5+
The CI build resulted in additional changed files.
6+
Typically this is due to not running yarn build locally before
7+
submitting a pull request.
8+
9+
The following changes were found:
10+
";
11+
12+
git diff --exit-code;
13+
fi;

dist/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,12 @@ var helloWord = function helloWord() {
1010
};
1111

1212
exports.helloWord = helloWord;
13+
"use strict";
14+
15+
var _ = require(".");
16+
17+
describe("helloWord", function () {
18+
test("is hello world", function () {
19+
expect((0, _.helloWord)()).toBe("Hello, World!");
20+
});
21+
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"build": "babel src -o dist/index.js",
88
"dev": "watch 'yarn run build' src",
99
"test": "jest",
10-
"test:watch": "yarn run test -- --watch"
10+
"test:watch": "yarn run test -- --watch",
11+
"check-git-clean": "./check-git-clean.sh"
1112
},
1213
"babel": {
1314
"presets": [

0 commit comments

Comments
 (0)