File tree Expand file tree Collapse file tree 6 files changed +79
-24
lines changed Expand file tree Collapse file tree 6 files changed +79
-24
lines changed Original file line number Diff line number Diff line change
1
+ /.git
Original file line number Diff line number Diff line change 1
- ---
1
+ name : ci
2
+
3
+ # Run on push and once a week to keep the images from bitrotting and to
4
+ # identify issues while no commits are being pushed.
2
5
on :
3
- push :
4
- branches : [master]
5
6
pull_request :
6
7
branches : [master]
7
8
schedule :
8
- - cron : ' 0 4 * * *' # Run at 04:00 every day.
9
+ - cron : " 52 2 * * 0"
10
+
11
+ # Cancel old PR builds when pushing new commits.
12
+ concurrency :
13
+ group : build-${{ github.event.pull_request.number || github.ref }}
14
+ cancel-in-progress : true
9
15
10
16
jobs :
11
17
build :
12
- runs-on : ubuntu-18.04
18
+ runs-on : ubuntu-latest
13
19
14
20
strategy :
15
21
matrix :
16
- node-version : [10.x, 12.x, 13.x]
22
+ node-version : [12.x, 13.x]
17
23
18
24
steps :
19
25
- uses : actions/checkout@v2
20
26
- name : Use Node.js ${{ matrix.node-version }}
21
- uses : actions/setup-node@v1
27
+ uses : actions/setup-node@v4
22
28
with :
23
29
node-version : ${{ matrix.node-version }}
24
30
- run : sudo apt-get install libopus-dev libsodium-dev libvpx-dev
43
49
- run : npm run report-coverage
44
50
- run : npm run format && git diff --exit-code
45
51
if : ${{ matrix.node-version == '13.x' }}
52
+
53
+ docker :
54
+ runs-on : ubuntu-latest
55
+ steps :
56
+ - name : Set up Docker Buildx
57
+ uses : docker/setup-buildx-action@v1
58
+ - name : Docker Build
59
+ uses : docker/build-push-action@v2
60
+ with :
61
+ tags : toxchat/js-toxcore-c:latest
Original file line number Diff line number Diff line change 1
- # load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
1
+ load ("@build_bazel_rules_nodejs//:index.bzl" , "nodejs_binary" )
2
2
load ("//tools/project:build_defs.bzl" , "project" )
3
3
4
4
project (license = "gpl3-https" )
5
5
6
- #exports_files(srcs = ["package.json"])
7
- #
8
- #nodejs_binary(
9
- # name = "js-toxcore-c",
10
- # entry_point = "lib/main.js",
11
- # visibility = ["//visibility:public"],
12
- # deps = ["@yarn_modules//:_all_"],
13
- #)
6
+ exports_files (srcs = [
7
+ "package.json" ,
8
+ "package-lock.json" ,
9
+ ])
10
+
11
+ nodejs_binary (
12
+ name = "js-toxcore-c" ,
13
+ data = glob (["lib/*.js" ]), # + ["@npm//ref-napi"],
14
+ entry_point = "lib/main.js" ,
15
+ visibility = ["//visibility:public" ],
16
+ )
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:22.04
2
+
3
+ RUN apt-get update && \
4
+ DEBIAN_FRONTEND="noninteractive" apt-get install -y --no-install-recommends \
5
+ ca-certificates \
6
+ build-essential \
7
+ cmake \
8
+ git \
9
+ libopus-dev \
10
+ libsodium-dev \
11
+ libvpx-dev \
12
+ ninja-build \
13
+ nodejs \
14
+ npm \
15
+ pkg-config \
16
+ && apt-get clean \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ WORKDIR /work/c-toxcore
20
+ RUN git clone --depth=1 --recurse-submodules --shallow-submodules --branch=master https://github.com/TokTok/c-toxcore.git /work/c-toxcore
21
+ RUN cmake -B_build -H. -GNinja
22
+ RUN cmake --build _build --target install
23
+
24
+ WORKDIR /work/js-toxcore-c
25
+ COPY . /work/js-toxcore-c/
26
+ ENV LD_LIBRARY_PATH=/usr/local/lib
27
+ RUN ls -l /usr/local/lib/libtoxcore.so
28
+ RUN npm install
29
+ RUN npm run doc
30
+ RUN npm run test
31
+ RUN npm run coverage
32
+ RUN npm run format
33
+ # COPY . /work/js-toxcore-c.orig/
34
+ # RUN diff -ru /work/js-toxcore-c /work/js-toxcore-c.orig
Original file line number Diff line number Diff line change 31
31
"scripts" : {
32
32
"doc" : " grunt jsdoc" ,
33
33
"test" : " nyc mocha" ,
34
- "report-coverage" : " nyc report --reporter=text-lcov > coverage.lcov && codecov" ,
34
+ "coverage" : " nyc report --reporter=text-lcov > coverage.lcov" ,
35
+ "report-coverage" : " nyc report --reporter=text-lcov > coverage.lcov && codecov" ,
35
36
"format" : " prettier --write \" **/*.js\" \" **/*.ts\" \" **/*.json\" "
36
37
},
37
38
"dependencies" : {
Original file line number Diff line number Diff line change 3
3
set -eux
4
4
5
5
# install toxcore
6
- if ! [ -d toxcore ]; then
7
- git clone --depth=1 --branch=master https://github.com/TokTok/toxcore.git toxcore
6
+ if ! [ -d c- toxcore ]; then
7
+ git clone --depth=1 --recurse-submodules --shallow-submodules -- branch=master https://github.com/TokTok/c- toxcore
8
8
fi
9
- cd toxcore
10
- git rev-parse HEAD > toxcore.sha
11
- if ! ([ -f " $CACHE_DIR /toxcore.sha" ] && diff " $CACHE_DIR /toxcore.sha" toxcore.sha); then
9
+ cd c- toxcore
10
+ git rev-parse HEAD > c- toxcore.sha
11
+ if ! ([ -f " $CACHE_DIR /c- toxcore.sha" ] && diff " $CACHE_DIR /c- toxcore.sha" c- toxcore.sha); then
12
12
cmake -B_build -H. -DCMAKE_INSTALL_PREFIX:PATH=" $HOME /cache/usr"
13
13
make -C_build -j" $( nproc) "
14
14
make -C_build install
15
- mv toxcore.sha " $CACHE_DIR /toxcore.sha"
15
+ mv c- toxcore.sha " $CACHE_DIR /c- toxcore.sha"
16
16
fi
17
17
cd ..
18
- rm -rf toxcore
18
+ rm -rf c- toxcore
You can’t perform that action at this time.
0 commit comments