Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
dockerize the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Crisci committed Apr 11, 2021
1 parent 73624b9 commit c706b93
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: node_js
language: minimal
sudo: required
dist: bionic
node_js:
- 6.17.0
- node
dist: focal
services:
- docker
before_install:
- sudo apt install -y dbus
- docker build -t node-dbus-next-test .
script:
- docker run -it node-dbus-next-test
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:20.04

WORKDIR /app

RUN echo force-unsafe-io > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup
RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry

RUN export DEBIAN_FRONTEND=noninteractive; \
export DEBCONF_NONINTERACTIVE_SEEN=true; \
echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
apt update && apt install -y --no-install-recommends \
build-essential \
curl \
ca-certificates \
git \
python2 \
dbus

ADD package.json /app

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash && \
. /root/.nvm/nvm.sh && \
for v in v6.17.1 v14.16.0; do \
nvm install $v; \
done ; \
npm install

ADD . /app

CMD [ "make", "test" ]
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: docker-test test

docker-test:
docker build -t node-dbus-next-test .
docker run -it node-dbus-next-test

test:
. /root/.nvm/nvm.sh ; \
for v in v6.17.1 v14.16.0 ; do \
nvm use $$v ; \
PYTHON=python2 npm install ; \
PYTHON=python2 npm rebuild ; \
dbus-run-session npm run test ; \
done

0 comments on commit c706b93

Please sign in to comment.