Skip to content

Commit

Permalink
chore: Add nodejs 20.x to the list of CI targets.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 27, 2024
1 parent f11cf79 commit 20e1ae3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 30 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.git
/Dockerfile
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
node-version: [12.x, 13.x]
node-version: [12.x, 13.x, 20.x]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- run: npm run test
- run: npm run report-coverage
- run: npm run format && git diff --exit-code
if: ${{ matrix.node-version == '13.x' }}
if: ${{ matrix.node-version == '20.x' }}

docker:
runs-on: ubuntu-latest
Expand Down
64 changes: 37 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,44 @@
FROM ubuntu:22.04
FROM alpine:3.19.0

RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
cmake \
git \
libopus-dev \
libsodium-dev \
libvpx-dev \
ninja-build \
nodejs \
npm \
pkg-config \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN ["apk", "add", "--no-cache", \
"cmake", \
"diffutils", \
"g++", \
"gcc", \
"git", \
"libsodium-dev", \
"libvpx-dev", \
"linux-headers", \
"make", \
"musl-dev", \
"npm", \
"opus-dev", \
"pkgconfig", \
"python3", \
"samurai"]

WORKDIR /work/c-toxcore
RUN git clone --depth=1 --recurse-submodules --shallow-submodules --branch=master https://github.com/TokTok/c-toxcore.git /work/c-toxcore
RUN cmake -B_build -H. -GNinja
RUN cmake --build _build --target install
RUN ["git", "clone", "--depth=1", \
"--recurse-submodules", "--shallow-submodules", \
"--branch=master", \
"https://github.com/TokTok/c-toxcore.git", "/work/c-toxcore"]
RUN ["cmake", "-B_build", "-H.", "-GNinja", "-DBOOTSTRAP_DAEMON=OFF"]
RUN ["cmake", "--build", "_build", "--target", "install"]

WORKDIR /work/js-toxcore-c
COPY . /work/js-toxcore-c/
ENV LD_LIBRARY_PATH=/usr/local/lib
RUN ls -l /usr/local/lib/libtoxcore.so
RUN npm install
RUN npm run doc
RUN npm run test
RUN npm run coverage
RUN npm run format
#COPY . /work/js-toxcore-c.orig/
#RUN diff -ru /work/js-toxcore-c /work/js-toxcore-c.orig
RUN ["ls", "-lh", "/usr/local/lib/libtoxcore.so.2"]
RUN ["npm", "install"]
RUN ["npm", "run", "doc"]
RUN ["npm", "run", "test"]
RUN ["npm", "run", "coverage"]
RUN ["npm", "run", "format"]
COPY . /work/js-toxcore-c.orig/
RUN rm -rf \
/work/js-toxcore-c*/.nyc_output \
/work/js-toxcore-c*/doc \
/work/js-toxcore-c*/node_modules \
/work/js-toxcore-c*/coverage.lcov \
/work/js-toxcore-c*/package-lock.json
RUN diff -ru /work/js-toxcore-c /work/js-toxcore-c.orig
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-toxcore-c",
"version": "0.2.0",
"version": "0.2.19",
"description": "Node bindings for libtoxcore",
"keywords": [
"im",
Expand Down

0 comments on commit 20e1ae3

Please sign in to comment.