Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
pull_request:

jobs:
native-linux-unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install native toolchain
run: |
sudo apt-get update
sudo apt-get install -y g++

- name: Build unit tests
working-directory: build
run: |
mkdir -p bin
g++ -c -std=c++11 -Wall -pedantic-errors -Wpedantic -Wconversion -DMOODYCAMEL_STATIC -pthread -g -O0 -fno-elide-constructors -fno-exceptions ../c_api/blockingconcurrentqueue.cpp ../c_api/concurrentqueue.cpp
g++ -std=c++11 -Wall -pedantic-errors -Wpedantic -Wconversion -DMOODYCAMEL_STATIC -pthread -g -O0 -fno-elide-constructors ../tests/common/simplethread.cpp ../tests/common/systemtime.cpp ../tests/unittests/unittests.cpp blockingconcurrentqueue.o concurrentqueue.o -o bin/unittests -lrt

- name: Run unit tests
working-directory: build
run: ./bin/unittests --disable-prompt --iterations 1

riscv64-linux-unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install RISC-V toolchain and QEMU
run: |
sudo apt-get update
sudo apt-get install -y g++-riscv64-linux-gnu qemu-user-static

- name: Build RISC-V unit tests
working-directory: build
run: |
mkdir -p bin-riscv
riscv64-linux-gnu-g++ -c -std=c++11 -Wall -pedantic-errors -Wpedantic -Wconversion -DMOODYCAMEL_STATIC -pthread -g -O0 -fno-elide-constructors -fno-exceptions ../c_api/blockingconcurrentqueue.cpp ../c_api/concurrentqueue.cpp
riscv64-linux-gnu-g++ -std=c++11 -Wall -pedantic-errors -Wpedantic -Wconversion -DMOODYCAMEL_STATIC -pthread -g -O0 -fno-elide-constructors ../tests/common/simplethread.cpp ../tests/common/systemtime.cpp ../tests/unittests/unittests.cpp blockingconcurrentqueue.o concurrentqueue.o -o bin-riscv/unittests-riscv64 -lrt

- name: Run RISC-V unit tests under QEMU
working-directory: build
run: qemu-riscv64-static -L /usr/riscv64-linux-gnu ./bin-riscv/unittests-riscv64 --disable-prompt --iterations 1
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ I've written quite a few unit tests as well as a randomized long-running fuzz te
core queue algorithm through the [CDSChecker][cdschecker] C++11 memory model model checker. Some of the
inner algorithms were tested separately using the [Relacy][relacy] model checker, and full integration
tests were also performed with Relacy.
I've tested
on Linux (Fedora 19) and Windows (7), but only on x86 processors so far (Intel and AMD). The code was
written to be platform-independent, however, and should work across all processors and OSes.
I've tested
on Linux (Fedora 19) and Windows (7) on x86 processors (Intel and AMD), and the GitHub Actions CI now also
cross-compiles and runs the unit tests for `riscv64` Linux under QEMU. The code was written to be
platform-independent, and should work across all processors and OSes.

Due to the complexity of the implementation and the difficult-to-test nature of lock-free code in general,
there may still be bugs. If anyone is seeing buggy behaviour, I'd like to hear about it! (Especially if
Expand Down