Skip to content

Commit 6d661fa

Browse files
authored
Merge pull request #94 from nut-tree/feature/13/matrix_builds
Feature/13/matrix builds
2 parents 2d2a0c1 + 2b8197a commit 6d661fa

File tree

9 files changed

+81
-20
lines changed

9 files changed

+81
-20
lines changed

.build/run_linux.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
echo $PWD
5+
6+
docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${NODE_VERSION}"

.build/run_osx.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
echo $PWD
5+
6+
npm ci
7+
npm run compile
8+
npm test

.build/setup_linux.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
5+
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
6+
sudo apt-get update
7+
sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
8+
docker pull s1hofmann/nut-ci:latest
9+
docker run -it -d --name nut-ci --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash

.build/setup_osx.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
set -e

.travis.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
os: linux
2-
dist: xenial
3-
4-
language: node_js
5-
node_js:
6-
- "lts/dubnium"
71
cache: npm
82

93
addons:
@@ -17,26 +11,40 @@ services:
1711

1812
matrix:
1913
include:
20-
- name: "Node 10"
14+
- name: "Linux Node 10"
15+
os: linux
16+
dist: xenial
2117
env: NODE_VERSION=10
22-
- name: "Node 11"
18+
- name: "Linux Node 11"
19+
os: linux
20+
dist: xenial
2321
env: NODE_VERSION=11
24-
- name: "Node 12"
22+
- name: "Linux Node 12"
23+
os: linux
24+
dist: xenial
2525
env: NODE_VERSION=12
26+
- name: "macOS Node 10"
27+
os: osx
28+
osx_image: xcode11
29+
language: node_js
30+
node_js: "10"
31+
- name: "macOS Node 11"
32+
os: osx
33+
osx_image: xcode11
34+
language: node_js
35+
node_js: "11"
36+
- name: "macOS Node 12"
37+
os: osx
38+
osx_image: xcode11
39+
language: node_js
40+
node_js: "12"
2641

2742
before_install:
28-
# Update Docker
29-
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
30-
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
31-
- sudo apt-get update
32-
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
33-
- docker pull s1hofmann/nut-ci:latest
34-
- docker run -it -d --name nut-ci --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
35-
43+
- "bash ./.build/setup_${TRAVIS_OS_NAME}.sh"
3644
install: true
3745

3846
script:
39-
- travis_retry docker exec nut-ci bash -c "bash $PWD/.build/build.sh ${PWD} ${NODE_VERSION}"
47+
- "bash ./.build/run_${TRAVIS_OS_NAME}.sh"
4048

4149
after_success:
4250
- sonar-scanner

appveyor.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
platform:
2+
- x64
3+
4+
image:
5+
- Visual Studio 2017
6+
7+
init:
8+
- git config --global core.autocrlf true
9+
10+
environment:
11+
matrix:
12+
- nodejs_version: "10"
13+
- nodejs_version: "11"
14+
- nodejs_version: "12"
15+
16+
clone_folder: c:\projects\nut
17+
18+
install:
19+
- ps: Install-Product node $env:nodejs_version x64
20+
- node --version
21+
- cd c:\projects\nut
22+
- npm ci
23+
- npm run compile
24+
25+
build: off
26+
27+
test_script:
28+
- npm test

lib/util/poll-action.function.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ describe("poll-action", () => {
8585
// GIVEN
8686
const updateInterval = 200;
8787
const maxDuration = 1000;
88-
const delay = 2.2 * updateInterval;
88+
const delay = 2.5 * updateInterval;
89+
const start = Date.now();
8990
const action = jest.fn(() => {
9091
const interval = (Date.now() - start);
9192
return new Promise<boolean>((resolve, reject) => (interval > delay) ? resolve(true) : reject());
9293
});
9394

9495
// WHEN
95-
const start = Date.now();
9696
await timeout(updateInterval, maxDuration, action);
9797
const end = Date.now();
9898

0 commit comments

Comments
 (0)