-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1afca85
commit 6c98518
Showing
9 changed files
with
284 additions
and
139 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
github: kimwalisch | ||
custom: "https://paypal.com/donate/?hosted_button_id=N3NHLPNYQFBRA" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
branches-ignore: | ||
- gh-pages | ||
|
||
jobs: | ||
linux_gcc_sanitizers: | ||
runs-on: ubuntu-latest | ||
env: | ||
CC: gcc | ||
CXX: g++ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build primesieve | ||
run: | | ||
cmake . -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-Wall -Wextra -pedantic -Werror -Wno-long-long -O1 -g -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer" -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror -Wno-long-long -O1 -g -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fno-omit-frame-pointer" | ||
make -j2 VERBOSE=1 | ||
- name: CTest (unit tests) | ||
run: ctest -j2 | ||
- name: primesieve --test option | ||
run: ./primesieve --test | ||
# Run primesieve binary | ||
- name: primesieve --cpu-info | ||
run: ./primesieve --cpu-info | ||
- name: primesieve 1e10 | ||
run: ./primesieve 1e10 | ||
- name: primesieve 1e9 --nth-prime | ||
run: ./primesieve 1e9 --nth-prime | ||
- name: primesieve --dist=1e9 --size=32 --print=6 | ||
run: ./primesieve 1e13 --dist=1e9 --size=32 --print=6 | ||
#Test printing primes and prime k-tuplets | ||
- name: primesieve 1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e8 -p | md5sum | cut -f1 -d' ')" != "4e2b0027288a27e9c99699364877c9db" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p2 | md5sum | cut -f1 -d' ')" != "5076d235d5b03389034ec107227eab98" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p3 | md5sum | cut -f1 -d' ')" != "1b40d7e67868ccc857df11c3e0f7e0f5" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p4 | md5sum | cut -f1 -d' ')" != "b998d7cdbeae6623cdecba1b921cb2e1" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p5 | md5sum | cut -f1 -d' ')" != "1ec7d5704d7399caf43667090b5bf836" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p6 | md5sum | cut -f1 -d' ')" != "0fb813d345c94cf2012588d1f71328b5" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p | md5sum | cut -f1 -d' ')" != "5fbe254a97ad3bbc07c224908c9d59b2" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p2 | md5sum | cut -f1 -d' ')" != "7a7a770c1841a17a9a63b92b7b6532b9" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p3 | md5sum | cut -f1 -d' ')" != "72323b08c62ad8342f7331e3d6d45a64" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p4 | md5sum | cut -f1 -d' ')" != "c2b0818499f77aa35681db3826caf3f6" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p5 | md5sum | cut -f1 -d' ')" != "11b50e4f75899891a62465f6d68fb76e" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p6 | md5sum | cut -f1 -d' ')" != "5a0bc83fdef0bb116d60f356adfde52f" ]; then exit 1; fi | ||
|
||
linux_gcc_valgrind: | ||
runs-on: ubuntu-latest | ||
env: | ||
CC: gcc | ||
CXX: g++ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install valgrind | ||
run: | | ||
sudo apt update | ||
sudo apt install valgrind asciidoc libxml2-utils xmlto | ||
- name: Build primesieve | ||
run: | | ||
cmake . -DBUILD_TESTS=ON -DBUILD_MANPAGE=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror -g" | ||
make -j2 VERBOSE=1 | ||
- name: CTest (unit tests) | ||
run: ctest -j2 | ||
- name: primesieve --test option | ||
run: ./primesieve --test | ||
- name: Valgrind primesieve count test | ||
run: valgrind --error-exitcode=1 ./primesieve 1e9 | ||
- name: Valgrind primesieve print test | ||
run: valgrind --error-exitcode=1 ./primesieve 10000 --print | ||
# Run primesieve binary | ||
- name: primesieve --cpu-info | ||
run: ./primesieve --cpu-info | ||
- name: primesieve 1e10 | ||
run: ./primesieve 1e10 | ||
- name: primesieve 1e9 --nth-prime | ||
run: ./primesieve 1e9 --nth-prime | ||
- name: primesieve --dist=1e9 --size=32 --print=6 | ||
run: ./primesieve 1e13 --dist=1e9 --size=32 --print=6 | ||
#Test printing primes and prime k-tuplets | ||
- name: primesieve 1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e8 -p | md5sum | cut -f1 -d' ')" != "4e2b0027288a27e9c99699364877c9db" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p2 | md5sum | cut -f1 -d' ')" != "5076d235d5b03389034ec107227eab98" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p3 | md5sum | cut -f1 -d' ')" != "1b40d7e67868ccc857df11c3e0f7e0f5" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p4 | md5sum | cut -f1 -d' ')" != "b998d7cdbeae6623cdecba1b921cb2e1" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p5 | md5sum | cut -f1 -d' ')" != "1ec7d5704d7399caf43667090b5bf836" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p6 | md5sum | cut -f1 -d' ')" != "0fb813d345c94cf2012588d1f71328b5" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p | md5sum | cut -f1 -d' ')" != "5fbe254a97ad3bbc07c224908c9d59b2" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p2 | md5sum | cut -f1 -d' ')" != "7a7a770c1841a17a9a63b92b7b6532b9" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p3 | md5sum | cut -f1 -d' ')" != "72323b08c62ad8342f7331e3d6d45a64" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p4 | md5sum | cut -f1 -d' ')" != "c2b0818499f77aa35681db3826caf3f6" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p5 | md5sum | cut -f1 -d' ')" != "11b50e4f75899891a62465f6d68fb76e" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p6 | md5sum | cut -f1 -d' ')" != "5a0bc83fdef0bb116d60f356adfde52f" ]; then exit 1; fi | ||
|
||
linux_clang: | ||
runs-on: ubuntu-latest | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libomp-dev | ||
- name: Build primesieve | ||
run: | | ||
cmake . -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" | ||
make -j2 VERBOSE=1 | ||
- name: CTest (unit tests) | ||
run: ctest -j2 | ||
- name: primesieve --test option | ||
run: ./primesieve --test | ||
# Run primesieve binary | ||
- name: primesieve --cpu-info | ||
run: ./primesieve --cpu-info | ||
- name: primesieve 1e10 | ||
run: ./primesieve 1e10 | ||
- name: primesieve 1e9 --nth-prime | ||
run: ./primesieve 1e9 --nth-prime | ||
- name: primesieve --dist=1e9 --size=32 --print=6 | ||
run: ./primesieve 1e13 --dist=1e9 --size=32 --print=6 | ||
#Test printing primes and prime k-tuplets | ||
- name: primesieve 1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e8 -p | md5sum | cut -f1 -d' ')" != "4e2b0027288a27e9c99699364877c9db" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p2 | md5sum | cut -f1 -d' ')" != "5076d235d5b03389034ec107227eab98" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p3 | md5sum | cut -f1 -d' ')" != "1b40d7e67868ccc857df11c3e0f7e0f5" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p4 | md5sum | cut -f1 -d' ')" != "b998d7cdbeae6623cdecba1b921cb2e1" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p5 | md5sum | cut -f1 -d' ')" != "1ec7d5704d7399caf43667090b5bf836" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e8 -p6 | md5sum | cut -f1 -d' ')" != "0fb813d345c94cf2012588d1f71328b5" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p | md5sum | cut -f1 -d' ')" != "5fbe254a97ad3bbc07c224908c9d59b2" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p2 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p2 | md5sum | cut -f1 -d' ')" != "7a7a770c1841a17a9a63b92b7b6532b9" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p3 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p3 | md5sum | cut -f1 -d' ')" != "72323b08c62ad8342f7331e3d6d45a64" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p4 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p4 | md5sum | cut -f1 -d' ')" != "c2b0818499f77aa35681db3826caf3f6" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p5 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p5 | md5sum | cut -f1 -d' ')" != "11b50e4f75899891a62465f6d68fb76e" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p6 | md5sum | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p6 | md5sum | cut -f1 -d' ')" != "5a0bc83fdef0bb116d60f356adfde52f" ]; then exit 1; fi | ||
|
||
macos_clang: | ||
runs-on: macos-latest | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build primesieve | ||
run: | | ||
cmake . -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$(pwd) | ||
make -j2 VERBOSE=1 | ||
make install | ||
- name: CTest (unit tests) | ||
run: ctest -j2 | ||
- name: primesieve --test option | ||
run: ./primesieve --test | ||
# Run primesieve binary | ||
- name: primesieve --cpu-info | ||
run: ./primesieve --cpu-info | ||
- name: primesieve 1e10 | ||
run: ./primesieve 1e10 | ||
- name: primesieve 1e9 --nth-prime | ||
run: ./primesieve 1e9 --nth-prime | ||
- name: primesieve --dist=1e9 --size=32 --print=6 | ||
run: ./primesieve 1e13 --dist=1e9 --size=32 --print=6 | ||
#Test printing primes and prime k-tuplets | ||
- name: primesieve 1e8 -p | md5 | ||
run: if [ "$(./primesieve 1e8 -p | md5 | cut -f1 -d' ')" != "4e2b0027288a27e9c99699364877c9db" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p2 | md5 | ||
run: if [ "$(./primesieve 1e8 -p2 | md5 | cut -f1 -d' ')" != "5076d235d5b03389034ec107227eab98" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p3 | md5 | ||
run: if [ "$(./primesieve 1e8 -p3 | md5 | cut -f1 -d' ')" != "1b40d7e67868ccc857df11c3e0f7e0f5" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p4 | md5 | ||
run: if [ "$(./primesieve 1e8 -p4 | md5 | cut -f1 -d' ')" != "b998d7cdbeae6623cdecba1b921cb2e1" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p5 | md5 | ||
run: if [ "$(./primesieve 1e8 -p5 | md5 | cut -f1 -d' ')" != "1ec7d5704d7399caf43667090b5bf836" ]; then exit 1; fi | ||
- name: primesieve 1e8 -p6 | md5 | ||
run: if [ "$(./primesieve 1e8 -p6 | md5 | cut -f1 -d' ')" != "0fb813d345c94cf2012588d1f71328b5" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p | md5 | cut -f1 -d' ')" != "5fbe254a97ad3bbc07c224908c9d59b2" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p2 | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p2 | md5 | cut -f1 -d' ')" != "7a7a770c1841a17a9a63b92b7b6532b9" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p3 | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p3 | md5 | cut -f1 -d' ')" != "72323b08c62ad8342f7331e3d6d45a64" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p4 | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p4 | md5 | cut -f1 -d' ')" != "c2b0818499f77aa35681db3826caf3f6" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p5 | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p5 | md5 | cut -f1 -d' ')" != "11b50e4f75899891a62465f6d68fb76e" ]; then exit 1; fi | ||
- name: primesieve 1e10 -d1e8 -p6 | md5 | ||
run: if [ "$(./primesieve 1e10 -d1e8 -p6 | md5 | cut -f1 -d' ')" != "5a0bc83fdef0bb116d60f356adfde52f" ]; then exit 1; fi | ||
|
||
# See documentation: https://www.msys2.org/docs/ci/ | ||
windows_mingw64: | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
update: true | ||
install: base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake | ||
- name: Build primesieve | ||
run: | | ||
cmake . -G "Unix Makefiles" -DBUILD_TESTS=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" | ||
make -j2 VERBOSE=1 | ||
- name: CTest (unit tests) | ||
run: ctest -j2 | ||
- name: primesieve --test option | ||
run: ./primesieve --test | ||
- name: primesieve --cpu-info | ||
run: ./primesieve --cpu-info | ||
- name: primesieve --print | ||
run: ./primesieve 1000 --print | ||
|
||
windows_msvc2022: | ||
runs-on: windows-2022 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build primesieve | ||
run: | | ||
cmake . -G "Visual Studio 17 2022" -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON | ||
cmake --build . --config Release --target install | ||
- name: CTest (unit tests) | ||
run: ctest -j2 -C Release --output-on-failure | ||
- name: primesieve --test option | ||
run: Release\primesieve.exe --test | ||
- name: primesieve --cpu-info | ||
run: Release\primesieve.exe --cpu-info | ||
- name: primesieve --print | ||
run: Release\primesieve.exe 1000 --print |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.* | ||
*~ | ||
!/.github | ||
!/.gitignore | ||
*.exe | ||
*.tar.gz | ||
|
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
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
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
Oops, something went wrong.