mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
de4af4c270
Instead of synchronously handling events as they happen in `tox_iterate`, this first collects all events in a structure and then lets the client process them. This allows clients to process events in parallel, since the data structure returned is mostly immutable. This also makes toxcore compatible with languages that don't (easily) support callbacks from C into the non-C language. If we remove the callbacks, this allows us to add fields to the events without breaking the API.
166 lines
4.8 KiB
YAML
166 lines
4.8 KiB
YAML
name: ci
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
mypy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python 3.9
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install mypy
|
|
run: pip install mypy
|
|
- name: Run mypy
|
|
run: |
|
|
(find . -name "*.py" -and -not -name "conanfile.py"; grep -lR '^#!.*python') \
|
|
| xargs -n1 -P8 mypy --strict
|
|
|
|
build-msan:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Pull toxchat/toktok-stack:latest-msan
|
|
run: docker pull toxchat/toktok-stack:latest-msan
|
|
- name: Run tests under MemorySanitizer
|
|
# TODO(iphydf): Remove "|| true" once this works correctly.
|
|
run: docker run --rm -v $PWD:/src/workspace/c-toxcore toxchat/toktok-stack:latest-msan
|
|
bazel test //c-toxcore/auto_tests:lossless_packet_test || true
|
|
|
|
build-nacl:
|
|
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:
|
|
file: other/docker/autotools/Dockerfile
|
|
|
|
build-win32:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Docker Build
|
|
run: .github/scripts/cmake-win32 install
|
|
- name: Cross compilation
|
|
run: .github/scripts/cmake-win32 script
|
|
|
|
build-win64:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Docker Build
|
|
run: .github/scripts/cmake-win64 install
|
|
- name: Cross compilation
|
|
run: .github/scripts/cmake-win64 script
|
|
|
|
build-freebsd:
|
|
runs-on: ubuntu-latest
|
|
container: toxchat/freebsd
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build on FreeBSD
|
|
run: .github/scripts/cmake-freebsd-stage2
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build and test
|
|
run: .github/scripts/cmake-osx
|
|
|
|
coverage-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build and test
|
|
run: .github/scripts/cmake-linux
|
|
env:
|
|
CC: gcc
|
|
CXX: g++
|
|
- name: Upload coverage
|
|
run: .github/scripts/upload-coverage
|
|
|
|
build-tcc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install dependencies
|
|
run:
|
|
sudo apt-get install -y --no-install-recommends
|
|
tcc
|
|
libconfig-dev
|
|
libopus-dev
|
|
libsodium-dev
|
|
libvpx-dev
|
|
- name: Build with TCC
|
|
run:
|
|
tcc
|
|
-o send_message_test
|
|
-Wall -Werror
|
|
-bench -g
|
|
auto_tests/auto_test_support.c
|
|
auto_tests/send_message_test.c
|
|
testing/misc_tools.c
|
|
toxav/*.c
|
|
toxcore/*.c
|
|
toxcore/*/*.c
|
|
toxencryptsave/*.c
|
|
$(pkg-config --cflags --libs libsodium opus vpx)
|
|
- name: Run the test
|
|
run: "./send_message_test | grep 'tox clients connected'"
|
|
- name: Build amalgamation file with TCC
|
|
run:
|
|
other/make_single_file
|
|
auto_tests/auto_test_support.c
|
|
auto_tests/send_message_test.c
|
|
testing/misc_tools.c |
|
|
tcc -
|
|
-o send_message_test
|
|
-Wall -Werror
|
|
-bench -g
|
|
$(pkg-config --cflags --libs libsodium opus vpx)
|
|
- name: Run the test again
|
|
run: "./send_message_test | grep 'tox clients connected'"
|
|
|
|
build-compcert:
|
|
runs-on: ubuntu-latest
|
|
container: toxchat/compcert
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Build with CompCert
|
|
run:
|
|
ccomp
|
|
-o send_message_test
|
|
-Wall -Werror
|
|
-Wno-c11-extensions
|
|
-Wno-unknown-pragmas
|
|
-Wno-unused-variable
|
|
-fstruct-passing -fno-unprototyped -g
|
|
auto_tests/auto_test_support.c
|
|
auto_tests/send_message_test.c
|
|
testing/misc_tools.c
|
|
toxav/*.c
|
|
toxcore/*.c
|
|
toxcore/*/*.c
|
|
toxencryptsave/*.c
|
|
-D__COMPCERT__ -DDISABLE_VLA
|
|
-lpthread $(pkg-config --cflags --libs libsodium opus vpx)
|
|
- name: Run the test
|
|
run: "./send_message_test | grep 'tox clients connected'"
|
|
|
|
buildifier:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Check
|
|
run: |
|
|
wget --no-verbose --output-document=buildifier https://github.com/bazelbuild/buildtools/releases/download/4.2.5/buildifier-linux-amd64
|
|
sudo chmod +x buildifier
|
|
./buildifier --lint=warn --warnings=all -mode diff $(find . -type f -name BUILD.bazel)
|