forked from saneki-discontinued/node-toxcore
-
Notifications
You must be signed in to change notification settings - Fork 8
64 lines (57 loc) · 1.98 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: ci
# Run on push and once a week to keep the images from bitrotting and to
# identify issues while no commits are being pushed.
on:
pull_request:
branches: [master]
schedule:
- cron: "52 2 * * 0"
# Cancel old PR builds when pushing new commits.
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
common:
uses: TokTok/ci-tools/.github/workflows/common-ci.yml@master
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 13.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: sudo apt-get install libopus-dev libsodium-dev libvpx-dev
- name: Set up environment variables
run: |
# GITHUB_ENV doesn't update the env vars in the current step, so export this one too.
export CACHE_DIR="$HOME/cache"
echo CACHE_DIR="$HOME/cache" >> $GITHUB_ENV
echo CFLAGS="-I$CACHE_DIR/usr/include -O3" >> $GITHUB_ENV
echo LDFLAGS="-L$CACHE_DIR/usr/lib" >> $GITHUB_ENV
echo LD_LIBRARY_PATH="$CACHE_DIR/usr/lib" >> $GITHUB_ENV
echo PKG_CONFIG_PATH="$CACHE_DIR/usr/lib/pkgconfig" >> $GITHUB_ENV
- name: Cache compiled dependencies
uses: actions/cache@v2
with:
path: ${{ env.CACHE_DIR }}
key: ${{ runner.OS }}-${{ hashFiles('tools/install-deps.sh') }}
- run: tools/install-deps.sh
- run: npm install
- run: npm run doc
- run: npm run test
- run: npm run report-coverage
- run: npm run format && git checkout package-lock.json && git diff --exit-code
if: ${{ matrix.node-version == '14.x' }}
docker:
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Build
uses: docker/build-push-action@v6
with:
tags: toxchat/js-toxcore-c:latest