Skip to content

ci

ci #504

Workflow file for this run

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, 20.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 == '20.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