Skip to content

Commit 868e0eb

Browse files
authored
CI (#58)
* Update CI config and ignore files * Update deps
1 parent a373920 commit 868e0eb

File tree

6 files changed

+520
-194
lines changed

6 files changed

+520
-194
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
coverage/
21
.nyc_output/
2+
coverage/
3+
node_modules/

.github/workflows/build.yml

+44-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Node CI
22

3-
# Push tests pushes; PR tests merges; create tests tags (and releases)
4-
on: [push, pull_request, create]
3+
# Push tests pushes; PR tests merges
4+
on: [push, pull_request]
55

66
jobs:
77

@@ -16,35 +16,58 @@ jobs:
1616

1717
# Go
1818
steps:
19-
- uses: actions/checkout@v1
20-
- uses: actions/setup-node@v1
19+
- name: Check out repo
20+
uses: actions/checkout@v1
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v1
2124
with:
2225
node-version: ${{ matrix.node-version }}
2326

24-
- name: Versions
25-
run: node --version
27+
- name: Env
28+
run: |
29+
echo "Event name: ${{ github.event_name }}"
30+
echo "Git ref: ${{ github.ref }}"
31+
echo "GH actor: ${{ github.actor }}"
32+
echo "SHA: ${{ github.sha }}"
33+
VER=`node --version`; echo "Node ver: $VER"
34+
VER=`npm --version`; echo "npm ver: $VER"
2635
2736
- name: Install
2837
run: npm install
2938

3039
- name: Test
3140
run: npm test
41+
env:
42+
CI: true
43+
44+
- name: Notify
45+
uses: homoluctus/slatify@master
46+
# Only fire alert once
47+
if: github.ref == 'refs/heads/master' && failure() && matrix.node-version == '10.x' && matrix.os == 'ubuntu-latest'
48+
with:
49+
type: ${{ job.status }}
50+
job_name: '*Build*'
51+
url: ${{ secrets.SLACK_WEBHOOK }}
3252

3353
# ----- Only git tag testing + package publishing beyond this point ----- #
3454

3555
# Publish to package registries
3656
publish:
3757
# Setup
3858
needs: build
39-
if: github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
59+
if: startsWith(github.ref, 'refs/tags/v')
4060
runs-on: ubuntu-latest
4161

4262
# Go
4363
steps:
44-
- uses: actions/checkout@v1
45-
- uses: actions/setup-node@v1
64+
- name: Check out repo
65+
uses: actions/checkout@v1
66+
67+
- name: Set up Node.js
68+
uses: actions/setup-node@v1
4669
with:
47-
node-version: 12
70+
node-version: 10
4871
registry-url: https://registry.npmjs.org/
4972

5073
- name: Install
@@ -64,9 +87,10 @@ jobs:
6487
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6588

6689
# Set up Node again, this time using GitHub as the publish target
67-
- uses: actions/setup-node@v1
90+
- name: Set up Node.js
91+
uses: actions/setup-node@v1
6892
with:
69-
node-version: 12
93+
node-version: 10
7094
registry-url: https://npm.pkg.github.com/
7195

7296
# Publish to GitHub
@@ -81,3 +105,11 @@ jobs:
81105
run: npm publish
82106
env:
83107
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
109+
- name: Notify
110+
uses: homoluctus/slatify@master
111+
if: always()
112+
with:
113+
type: ${{ job.status }}
114+
job_name: '*Publish*'
115+
url: ${{ secrets.SLACK_WEBHOOK }}

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
node_modules/
2-
coverage/
31
.nyc_output/
2+
coverage/
3+
node_modules/

.npmignore

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
test/
2-
.github
3-
.nyc_output
41
.eslintignore
52
.eslintrc.js
6-
.travis.yml
7-
appveyor.yml
3+
.git/
4+
.github/
5+
.nyc_output/
86
codecov.yaml
97
coverage/
8+
test/

0 commit comments

Comments
 (0)