Skip to content

Commit 81cea51

Browse files
Switched from Travis CI to GitHub Actions
1 parent 0c629bb commit 81cea51

File tree

14 files changed

+6624
-6847
lines changed

14 files changed

+6624
-6847
lines changed

.eslintrc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
root: true
66

77
extends:
8-
- modular/best-practices
9-
- modular/style
10-
- modular/browser
11-
- modular/node
12-
- modular/es6
8+
- "@jsdevtools/modular/best-practices"
9+
- "@jsdevtools/modular/style"
10+
- "@jsdevtools/modular/browser"
11+
- "@jsdevtools/modular/node"
12+
- "@jsdevtools/modular/es6"

.github/workflows/CI-CD.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# GitHub Actions workflow
2+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions
3+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions
4+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions
5+
6+
name: CI-CD
7+
8+
on:
9+
push:
10+
branches:
11+
- "*"
12+
tags-ignore:
13+
- "*"
14+
15+
schedule:
16+
- cron: "0 0 1 * *"
17+
18+
jobs:
19+
node_tests:
20+
name: Node ${{ matrix.node }} on ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
timeout-minutes: 10
23+
strategy:
24+
fail-fast: true
25+
matrix:
26+
os:
27+
- ubuntu-latest
28+
- macos-latest
29+
- windows-latest
30+
node:
31+
- 10
32+
- 12
33+
34+
steps:
35+
- name: Checkout source
36+
uses: actions/checkout@v2
37+
38+
- name: Install Node ${{ matrix.node }}
39+
uses: actions/setup-node@v1
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: Install dependencies
44+
run: npm ci
45+
46+
- name: Run linter
47+
run: npm run lint
48+
49+
- name: Build the code
50+
run: npm run build
51+
52+
- name: Run TypeScript tests
53+
run: npm run test:typescript
54+
55+
- name: Run Node tests
56+
run: npm run coverage:node
57+
58+
- name: Send code coverage results to Coveralls
59+
uses: coverallsapp/github-action@v1.0.1
60+
with:
61+
github-token: ${{ secrets.GITHUB_TOKEN }}
62+
parallel: true
63+
64+
browser_tests:
65+
name: Browser Tests
66+
runs-on: ${{ matrix.os }}
67+
timeout-minutes: 10
68+
strategy:
69+
fail-fast: true
70+
matrix:
71+
os:
72+
- ubuntu-latest # Chrome, Firefox, Safari (via SauceLabs), Edge (via SauceLabs)
73+
- windows-latest # Internet Explorer
74+
75+
steps:
76+
- name: Checkout source
77+
uses: actions/checkout@v2
78+
79+
- name: Install Node
80+
uses: actions/setup-node@v1
81+
with:
82+
node-version: 12
83+
84+
- name: Install dependencies
85+
run: npm ci
86+
87+
- name: Build the code
88+
run: npm run build
89+
90+
- name: Run tests
91+
run: npm run coverage:browser
92+
env:
93+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
94+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
95+
96+
- name: Combine code coverage data into a single file
97+
shell: bash
98+
run: |
99+
ls -Rlh coverage/*/lcov.info
100+
cat coverage/*/lcov.info > ./coverage/lcov.info
101+
102+
- name: Send code coverage results to Coveralls
103+
uses: coverallsapp/github-action@v1.0.1
104+
with:
105+
github-token: ${{ secrets.GITHUB_TOKEN }}
106+
parallel: true
107+
108+
coverage:
109+
name: Code Coverage
110+
runs-on: ubuntu-latest
111+
timeout-minutes: 10
112+
needs:
113+
- node_tests
114+
- browser_tests
115+
steps:
116+
- name: Let Coveralls know that all tests have finished
117+
uses: coverallsapp/github-action@v1.0.1
118+
with:
119+
github-token: ${{ secrets.GITHUB_TOKEN }}
120+
parallel-finished: true
121+
122+
deploy:
123+
name: Publish to NPM
124+
if: github.ref == 'refs/heads/master'
125+
runs-on: ubuntu-latest
126+
timeout-minutes: 10
127+
needs:
128+
- node_tests
129+
- browser_tests
130+
131+
steps:
132+
- name: Checkout source
133+
uses: actions/checkout@v2
134+
135+
- name: Install Node
136+
uses: actions/setup-node@v1
137+
138+
- name: Install dependencies
139+
run: npm ci
140+
141+
- name: Build the code
142+
run: npm run build
143+
144+
- name: Publish to NPM
145+
uses: JS-DevTools/npm-publish@v1
146+
with:
147+
token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ nbproject
1313
# IDEs & Text Editors
1414
.idea
1515
.sublime-*
16-
.vscode
16+
.vscode/settings.json
1717
.netbeans
1818
nbproject
1919

.travis.yml

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

.vscode/launch.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// VSCode Launch Configuration
2+
// https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "0.2.0",
14+
"configurations": [
15+
{
16+
"name": "Run Mocha",
17+
"type": "node",
18+
"runtimeArgs": [
19+
"--nolazy"
20+
],
21+
"request": "launch",
22+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
23+
"stopOnEntry": false,
24+
"args": [
25+
"--timeout=600000",
26+
"--retries=0",
27+
],
28+
"env": {
29+
"NODE_ENV": "test"
30+
},
31+
"cwd": "${workspaceRoot}",
32+
"console": "internalConsole",
33+
"sourceMaps": true,
34+
"outFiles": [
35+
"${workspaceRoot}/cjs/**/*.js",
36+
],
37+
"smartStep": true,
38+
"skipFiles": [
39+
"<node_internals>/**/*.js"
40+
],
41+
},
42+
43+
{
44+
"name": "Run Karma",
45+
"type": "node",
46+
"runtimeArgs": [
47+
"--nolazy"
48+
],
49+
"request": "launch",
50+
"program": "${workspaceRoot}/node_modules/karma/bin/karma",
51+
"stopOnEntry": false,
52+
"args": [
53+
"start",
54+
"--single-run"
55+
],
56+
"env": {
57+
"NODE_ENV": "test"
58+
},
59+
"cwd": "${workspaceRoot}",
60+
"console": "internalConsole",
61+
"outputCapture": "std",
62+
"sourceMaps": false,
63+
"outFiles": [
64+
"${workspaceRoot}/esm/**/*.js",
65+
],
66+
"smartStep": true,
67+
"skipFiles": [
68+
"<node_internals>/**/*.js"
69+
],
70+
}
71+
]
72+
}

.vscode/tasks.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// VSCode Tasks
2+
// https://code.visualstudio.com/docs/editor/tasks
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "2.0.0",
14+
"command": "npm",
15+
"tasks": [
16+
{
17+
"type": "npm",
18+
"script": "build",
19+
"group": {
20+
"kind": "build",
21+
"isDefault": true
22+
},
23+
"problemMatcher": "$tsc",
24+
},
25+
{
26+
"type": "npm",
27+
"script": "test:node",
28+
"group": {
29+
"kind": "test",
30+
"isDefault": true
31+
},
32+
},
33+
]
34+
}

karma.conf.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@
33
// https://jstools.dev/karma-config/
44

55
"use strict";
6-
const { karmaConfig } = require("karma-config");
6+
const { karmaConfig } = require("@jsdevtools/karma-config");
7+
const { host } = require("@jsdevtools/host-environment");
78

89
module.exports = karmaConfig({
910
sourceDir: "esm",
1011
fixtures: "test/fixtures/**/*.js",
1112
browsers: {
12-
ie: true,
13+
chrome: true,
14+
firefox: host.os.linux,
15+
safari: host.os.linux, // SauceLabs
16+
edge: host.os.linux, // SauceLabs
17+
ie: host.os.windows,
1318
},
1419
});

0 commit comments

Comments
 (0)