Skip to content

Commit

Permalink
feat: Add more diff tests.
Browse files Browse the repository at this point in the history
These help make sure all repos have the same configs.
  • Loading branch information
iphydf committed Feb 19, 2025
1 parent 1b2e494 commit afb78a5
Show file tree
Hide file tree
Showing 63 changed files with 386 additions and 257 deletions.
16 changes: 8 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,8 @@ build:nix --build_tag_filters=-windows,-macos
build:nix --test_tag_filters=-windows,-macos

# Non-Nix local toolchains. Nix-Haskell doesn't work with local toolchains.
build:local --build_tag_filters=-no-cross,-windows,-macos,-ui
build:local --test_tag_filters=-no-cross,-windows,-macos,-ui
build:local --build_tag_filters=-windows,-macos,-ui,-java,-javascript,-haskell,-no-cross
build:local --test_tag_filters=-windows,-macos,-ui,-java,-javascript,-haskell,-no-cross

build:zig-cross --copt=-fPIC
build:zig-cross --dynamic_mode=off
Expand All @@ -768,22 +768,22 @@ build:zig-cross --per_file_copt='external/sdl2[:/]@-DICONV_INBUF_NONCONST=1'
build:linux-arm64-musl --config=zig-cross
build:linux-arm64-musl --platforms=@zig_sdk//platform:linux_arm64
build:linux-arm64-musl --extra_toolchains=@zig_sdk//toolchain:linux_arm64_musl
build:linux-arm64-musl --build_tag_filters=-no-cross,-qt,-windows,-macos,-java
build:linux-arm64-musl --test_tag_filters=-no-cross,-qt,-windows,-macos,-java
build:linux-arm64-musl --build_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross
build:linux-arm64-musl --test_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross

build:linux-x86_64-musl --config=zig-cross
build:linux-x86_64-musl --platforms=@zig_sdk//platform:linux_amd64
build:linux-x86_64-musl --extra_toolchains=@zig_sdk//toolchain:linux_amd64_musl
build:linux-x86_64-musl --build_tag_filters=-no-cross,-qt,-windows,-macos
build:linux-x86_64-musl --test_tag_filters=-no-cross,-qt,-windows,-macos
build:linux-x86_64-musl --build_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross
build:linux-x86_64-musl --test_tag_filters=-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross
build:linux-x86_64-musl --linkopt='-static'

build:windows-x86_64 --config=zig-cross
build:windows-x86_64 --linkopt="-lshlwapi"
build:windows-x86_64 --platforms=@zig_sdk//platform:windows_amd64
build:windows-x86_64 --extra_toolchains=@zig_sdk//toolchain:windows_amd64
build:windows-x86_64 --build_tag_filters=-no-cross,-qt,-macos,-java,-no-windows
build:windows-x86_64 --test_tag_filters=-no-cross,-qt,-macos,-java,-no-windows
build:windows-x86_64 --build_tag_filters=-no-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross
build:windows-x86_64 --test_tag_filters=-no-windows,-macos,-java,-haskell,-javascript,-qt,-no-cross

try-import %workspace%/.local.bazelrc

Expand Down
72 changes: 40 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,60 +42,68 @@ jobs:
docker-test:
runs-on: ubuntu-22.04
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: actions/checkout@v4
with:
submodules: recursive

- name: Build toxchat/toktok-stack:latest-third_party
run: docker build -t toxchat/toktok-stack:latest-third_party -f tools/built/src/Dockerfile.third_party .
run: docker compose build third_party

- name: Build toxchat/toktok-stack:latest
run: docker build -t toxchat/toktok-stack:latest -f tools/built/src/Dockerfile .
run: docker compose build latest

- name: Build toxchat/toktok-stack:latest-msan
- name: Set up environment
run: |
docker build -t toxchat/toktok-stack:latest-msan -f tools/built/src/Dockerfile.msan .
docker rmi toxchat/toktok-stack:latest-msan
docker system prune -f
echo "GROUP_ID=$(id -g)" >.env
echo "USER_ID=$(id -u)" >>.env
- name: Build toxchat/toktok-stack:latest-asan
- name: Build for msan
run: |
docker build -t toxchat/toktok-stack:latest-asan -f tools/built/src/Dockerfile.asan .
docker rmi toxchat/toktok-stack:latest-asan
docker system prune -f
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/msan.tar)
docker compose run --rm msan
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-release
- name: Build for asan
run: |
docker build -t toxchat/toktok-stack:latest-release -f tools/built/src/Dockerfile.release .
docker rmi toxchat/toktok-stack:latest-release
docker system prune -f
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/asan.tar)
docker compose run --rm asan
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-arm64
- name: Build for release
run: |
docker build -t toxchat/toktok-stack:latest-arm64 -f tools/built/src/Dockerfile.arm64 .
docker rmi toxchat/toktok-stack:latest-arm64
docker system prune -f
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/release.tar)
docker compose run --rm release
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-windows
- name: Build for arm64
run: |
docker build -t toxchat/toktok-stack:latest-windows -f tools/built/src/Dockerfile.windows .
docker rmi toxchat/toktok-stack:latest-windows
docker system prune -f
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/arm64.tar)
docker compose run --rm arm64
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-fastbuild
run: docker build -t toxchat/toktok-stack:latest-fastbuild -f tools/built/src/Dockerfile.fastbuild .
- name: Build for windows
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/windows.tar)
docker compose run --rm windows
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-dev
- name: Build for fastbuild
run: |
sed -i -e 's/ --remote_download_outputs=all//' tools/built/src/setup-dev.sh
docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev .
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/fastbuild.tar)
docker compose run --rm fastbuild
docker kill bazel-cache
rm -rf ../bazel-cache
- name: Build toxchat/toktok-stack:latest-dev
run: docker build -t toxchat/toktok-stack:latest-dev -f tools/built/src/Dockerfile.dev .

local-build:
runs-on: ubuntu-24.04
# if: false
env:
CC: clang
CXX: clang++
Expand All @@ -121,7 +129,7 @@ jobs:
run: |
. /home/runner/.nix-profile/etc/profile.d/nix.sh
nix-shell -p patchelf --run "patchelf --version"
bazel test --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/...
bazel test --config=ci --config=local --config=remote -- //... -//jvm-toxcore-c/... -//third_party/...
macos:
runs-on: macos-14
Expand Down
58 changes: 21 additions & 37 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,9 @@ jobs:
cache-to: type=inline
push: true

docker-fastbuild:
runs-on: ubuntu-22.04
needs: [docker]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: tools/built/src/Dockerfile.fastbuild
tags: toxchat/toktok-stack:latest-fastbuild
cache-from: type=registry,ref=toxchat/toktok-stack:latest-fastbuild
cache-to: type=inline
push: true

docker-dev:
runs-on: ubuntu-22.04
needs: [docker-fastbuild]
needs: [docker]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -108,26 +88,30 @@ jobs:
cache-to: type=inline
push: true

docker-built:
bazel-cache:
strategy:
fail-fast: false
matrix:
flavour: [release, debug, asan, msan, tsan, arm64, windows]
flavour: [fastbuild, release, debug, asan, msan, tsan, arm64, windows]
runs-on: ubuntu-22.04
needs: [docker]
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
- name: Set up environment
run: |
echo "GROUP_ID=$(id -g)" >.env
echo "USER_ID=$(id -u)" >>.env
- name: Download current cache and run the build
run: |
tar -C .. -xf <(curl -L https://github.com/TokTok/toktok-stack/releases/download/nightly/${{ matrix.flavour }}.tar) || mkdir -p ../bazel-cache
docker compose run --rm ${{ matrix.flavour }}
tar -C .. -cf ${{ matrix.flavour }}.tar bazel-cache
- name: Upload updated cache to nightly release
uses: ncipollo/release-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
file: tools/built/src/Dockerfile.${{ matrix.flavour }}
tags: toxchat/toktok-stack:latest-${{ matrix.flavour }}
cache-from: type=registry,ref=toxchat/toktok-stack:latest-${{ matrix.flavour }}
cache-to: type=inline
push: true
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
artifacts: ${{ matrix.flavour }}.tar
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Build artifacts.
/.cache
/.clangd
/.env
/.vs
/.vscode
/.stack-work
/stack.yaml.lock
/bazel-*
/cov-analysis*
/external
/go.work.sum
/toolchain
/MODULE.bazel.lock
*.log
Expand Down
2 changes: 1 addition & 1 deletion btox
Submodule btox updated 102 files
2 changes: 1 addition & 1 deletion ci_tools
Submodule ci_tools updated 42 files
+3 −0 .clog.toml
+24 −0 .github/ISSUE_TEMPLATE/release.yaml
+2 −0 .github/workflows/check-release.yml
+16 −0 .github/workflows/ci.yml
+3 −0 .github/workflows/common-ci.yml
+2 −1 .github/workflows/deploy-appimage.yml
+1 −1 .github/workflows/deploy-artifact.yml
+1 −1 .github/workflows/deploy-flatpak.yml
+2 −2 .github/workflows/deploy-macos.yml
+27 −0 .github/workflows/deploy-prepare.yml
+1 −1 .github/workflows/deploy-windows.yml
+25 −0 .github/workflows/draft.yml
+2 −0 .github/workflows/haskell-ci.yml
+2 −0 .github/workflows/haskell-publish.yml
+2 −0 .github/workflows/netlify.yml
+24 −5 .github/workflows/release-deploy.yml
+2 −0 .github/workflows/release-drafter.yml
+6 −0 .github/workflows/release-soon.yml
+12 −6 .github/workflows/release.yml
+3 −0 .netlify/state.json
+76 −0 .reviewable/completion.js
+4 −0 .reviewable/settings.yaml
+103 −0 CHANGELOG.md
+6 −6 README.md
+14 −1 cmake/Installation.cmake
+1 −1 platform/android/cross-compile/build.sh
+6 −1 platform/flatpak/build.sh
+2 −1 platform/macos/createdmg
+5 −3 platform/windows/cross-compile/build.sh
+1 −3 platform/windows/generate-icon.sh
+6 −0 tools/add_upstream_remote.sh
+35 −4 tools/create_release.py
+1 −1 tools/lib/changelog.py
+87 −71 tools/lib/git.py
+87 −58 tools/lib/github.py
+70 −0 tools/sign_tag.py
+24 −0 tools/update-versions.sh
+2 −1 tools/update_changelog.py
+7 −5 tools/update_flathub_descriptor_dependencies.py
+0 −3 tools/use_github_actions_identity.sh
+17 −15 tools/validate_pr.py
+9 −7 tools/verify_release_assets.py
79 changes: 79 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
x-shared-params: &shared_params
container_name: bazel-build
depends_on:
- bazel-cache
build:
context: .
dockerfile: tools/built/src/Dockerfile
image: toxchat/toktok-stack:latest
environment:
HOME: /home/builder

services:
bazel-cache:
user: ${USER_ID}:${GROUP_ID}
container_name: bazel-cache
image: buchgr/bazel-remote-cache
restart: on-failure
ports:
- "9092:9092"
command: --max_size=1
volumes:
- ../bazel-cache:/data
environment:
BAZEL_REMOTE_GRPC_PORT: 9092
third_party:
build:
context: .
dockerfile: tools/built/src/Dockerfile.third_party
image: toxchat/toktok-stack:latest-third_party

latest:
<<: *shared_params

fastbuild:
<<: *shared_params
command: bazel test
--remote_cache=grpc://bazel-cache:9092
//...

arm64:
<<: *shared_params
command: bazel build
--remote_cache=grpc://bazel-cache:9092
--config=linux-arm64-musl
//...

asan:
<<: *shared_params
command: bazel test
--remote_cache=grpc://bazel-cache:9092
--config=asan
--build_tag_filters=-haskell,-fuzz-test
--test_tag_filters=-haskell,-fuzz-test
//c-toxcore/...

msan:
<<: *shared_params
command: bazel test
--remote_cache=grpc://bazel-cache:9092
--config=msan
--build_tag_filters=-haskell,-fuzz-test
--test_tag_filters=-haskell,-fuzz-test
--
//c-toxcore/auto_tests/...
-//c-toxcore/auto_tests:proxy_test

release:
<<: *shared_params
command: bazel test
--remote_cache=grpc://bazel-cache:9092
--config=release
//...

windows:
<<: *shared_params
command: bazel build
--remote_cache=grpc://bazel-cache:9092
--config=windows-x86_64
//...
14 changes: 14 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ words:
- blargh
- blyat
- blyatyfy
- buildifier
- buildx
- ccache
- choco
- citri
- codesign
- createdmg
- depfile
- depset
- diffutils
- dockerfiles
- dryrun
- dups
- endforeach
- fastbuild
- flathub
- fmap
- genrule
- gitmodules
- hditool
- icotool
- libc
- libfuzzer
Expand All @@ -30,6 +39,7 @@ words:
- magick
- makensis
- mempty
- mkstamp
- mypy
- ncipollo
- nixpkgs
Expand All @@ -38,7 +48,11 @@ words:
- qtox
- qttools
- realpath
- rfind
- runfiles
- sqlcipher
- srcs
- startswith
- teehee
- toktok
- toplevel
Expand Down
2 changes: 1 addition & 1 deletion debugtox
Submodule debugtox updated 49 files
+84 −0 .clang-format
+3 −0 .clog.toml
+24 −0 .github/ISSUE_TEMPLATE/release.yml
+70 −0 .github/workflows/build-test-deploy.yml
+25 −0 .github/workflows/draft.yml
+7 −14 .github/workflows/release.yml
+0 −1 .gitignore
+5 −0 .restyled.yaml
+76 −0 .reviewable/completion.js
+4 −0 .reviewable/settings.yaml
+11 −0 CHANGELOG.md
+31 −28 CMakeLists.txt
+42 −2 CMakePresets.json
+1 −1 README.md
+78 −0 cmake/Installation.cmake
+51 −0 platform/android/qt-6.2.4/AndroidManifest.xml
+55 −0 platform/android/qt-6.8.1/AndroidManifest.xml
+5 −0 platform/deps.depfile
+63 −0 platform/flatpak/chat.tox.DebugTox.json
+33 −0 platform/linux/chat.tox.DebugTox.appdata.xml
+11 −0 platform/linux/chat.tox.DebugTox.desktop
+12 −0 platform/macos/Brewfile-static
+26 −0 platform/macos/Info.plist
+ platform/macos/backgroundImage.tiff
+1 −0 platform/wasm/wasm.Dockerfile
+1 −0 platform/wasm/wasm.Dockerfile.dockerignore
+18 −0 platform/windows/cross-compile/dll-deps
+ platform/windows/debugtox.ico
+1 −0 platform/windows/debugtox.rc
+343 −0 platform/windows/debugtox64.nsi
+ resources/images/icons/128x128/debugtox.png
+ resources/images/icons/14x14/debugtox.png
+ resources/images/icons/16x16/debugtox.png
+ resources/images/icons/192x192/debugtox.png
+ resources/images/icons/22x22/debugtox.png
+ resources/images/icons/24x24/debugtox.png
+ resources/images/icons/256x256/debugtox.png
+ resources/images/icons/32x32/debugtox.png
+ resources/images/icons/36x36/debugtox.png
+ resources/images/icons/48x48/debugtox.png
+ resources/images/icons/512x512/debugtox.png
+ resources/images/icons/64x64/debugtox.png
+ resources/images/icons/72x72/debugtox.png
+ resources/images/icons/96x96/debugtox.png
+ resources/images/icons/debugtox.icns
+4 −0 resources/images/icons/debugtox.svg
+7 −0 src/main.cpp
+5 −0 test/smoke-test.sh
+2 −0 third_party/.gitignore
2 changes: 1 addition & 1 deletion dockerfiles
2 changes: 1 addition & 1 deletion hs-apigen
2 changes: 1 addition & 1 deletion hs-cimple
2 changes: 1 addition & 1 deletion hs-happy-arbitrary
Loading

0 comments on commit afb78a5

Please sign in to comment.