fix: Make js-toxcore-c compatible with ref-napi 2 and higher. #467
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
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 diff --exit-code | |
if: ${{ matrix.node-version == '13.x' }} | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Docker Build | |
uses: docker/build-push-action@v2 | |
with: | |
tags: toxchat/js-toxcore-c:latest |