Adapt e-antic to FLINT 3 #620
Workflow file for this run
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
name: Test | |
on: | |
push: { branches: [ "master" ] } | |
pull_request: { branches: [ "master" ] } | |
concurrency: | |
group: test-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-libeantic: | |
runs-on: ${{ matrix.on }} | |
strategy: | |
matrix: | |
include: | |
- on: ubuntu-22.04 | |
libflint: 2.6 | |
- on: ubuntu-22.04 | |
libflint: 2.7 | |
- on: ubuntu-22.04 | |
libflint: 2.8 | |
- on: ubuntu-22.04 | |
libflint: 2.9 | |
- on: ubuntu-22.04 | |
libflint: 3.0 | |
- on: ubuntu-22.04 | |
libflint: 2.9 | |
sanitizer: address | |
- on: ubuntu-22.04 | |
libflint: 2.9 | |
sanitizer: undefined | |
- on: ubuntu-22.04 | |
libflint: 2.9 | |
sanitizer: valgrind | |
- on: ubuntu-22.04 | |
libflint: 3.0 | |
sanitizer: address | |
- on: ubuntu-22.04 | |
libflint: 3.0 | |
sanitizer: undefined | |
- on: ubuntu-22.04 | |
libflint: 3.0 | |
sanitizer: valgrind | |
# This test is not terribly useful and very flaky. It should be replaced with something like https://github.com/flatsurf/sage-flatsurf/pull/190 | |
# Note that we should also run pyeantic tests here. | |
# - on: ubuntu-22.04 | |
# environment: binder | |
- on: macos-11 | |
libflint: 2.6 | |
- on: macos-11 | |
libflint: 2.7 | |
- on: macos-11 | |
libflint: 2.8 | |
- on: macos-11 | |
libflint: 2.9 | |
- on: macos-11 | |
libflint: 3.0 | |
- on: macos-11 | |
libflint: 2.9 | |
sanitizer: address | |
- on: macos-11 | |
libflint: 2.9 | |
sanitizer: undefined | |
- on: macos-11 | |
libflint: 3.0 | |
sanitizer: address | |
- on: macos-11 | |
libflint: 3.0 | |
sanitizer: undefined | |
steps: | |
- uses: actions/checkout@v2 | |
with: { submodules: recursive } | |
- name: build flags | |
id: flags | |
shell: bash -l {0} | |
run: | | |
echo "::set-output name=configure::"`[[ ${{ runner.os }} == "Linux" ]] && echo "--with-version-script"` `[[ "${{ matrix.sanitizer }}" == "address" || "${{ matrix.sanitizer }}" == "undefined" ]] && echo "--without-byexample"` `[[ "${{ matrix.sanitizer }}" == "valgrind" ]] && echo "--enable-valgrind"` | |
echo "::set-output name=shared::"`[[ "${{ matrix.sanitizer }}" == "address" ]] && echo "-fsanitize=address -fno-sanitize-recover -fno-omit-frame-pointer"` `[[ "${{ matrix.sanitizer }}" == "undefined" ]] && echo "-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"` | |
echo "::set-output name=linker::"`[[ "${{ matrix.sanitizer }}" == "address" ]] && echo "-fsanitize=address"` `[[ "${{ matrix.sanitizer }}" == "undefined" ]] && echo "-fsanitize=undefined"` | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest" } | |
- name: install valgrind | |
shell: bash -l {0} | |
run: | | |
sudo apt update | |
sudo apt install -y libc6-dbg | |
mamba install valgrind | |
if: ${{ matrix.sanitizer == 'valgrind' }} | |
- name: install dependencies (FLINT 3) | |
shell: bash -l {0} | |
run: | | |
mamba env update --quiet -n test -f libeantic/environment.yml | |
mamba install libflint=${{ matrix.libflint }} | |
conda list | |
if: startsWith(matrix.libflint, '3') | |
- name: install dependencies (FLINT 2) | |
shell: bash -l {0} | |
run: | | |
mamba env update --quiet -n test -f libeantic/environment-flint2.yml | |
mamba install libflint=${{ matrix.libflint }} | |
conda list | |
if: startsWith(matrix.libflint, '2') | |
- name: Create binder environment | |
shell: bash -l {0} | |
run: | | |
wget -O repo2docker.yml https://github.com/jupyterhub/repo2docker/raw/main/repo2docker/buildpacks/conda/environment.yml | |
mamba install -n test --quiet -y pytest pytest-xdist byexample py | |
mamba env update -n test --quiet -f repo2docker.yml | |
mamba env update -n test --quiet -f binder/environment.yml | |
conda list | |
if: ${{ matrix.environment == 'binder' }} | |
- name: configure & build & test | |
shell: bash -l {0} | |
run: | | |
echo "::group::bootstrap" | |
./bootstrap | |
echo "::group::configure" | |
cd libeantic | |
export CFLAGS="$CFLAGS -UNDEBUG -g3 ${{ steps.flags.outputs.shared }}" | |
export CXXFLAGS="$CXXFLAGS -UNDEBUG -g3 -fvisibility=hidden -fvisibility-inlines-hidden ${{ steps.flags.outputs.shared }}" | |
export LDFLAGS="$LDFLAGS ${{ steps.flags.outputs.shared }} ${{ steps.flags.outputs.linker }}" | |
./configure --without-benchmark ${{ steps.flags.outputs.configure }} --without-doc | |
echo "::group::make" | |
make V=1 | |
echo "::group::test" | |
make V=1 `[[ "${{ matrix.sanitizer }}" == "valgrind" ]] && echo check-valgrind || echo check` | |
- uses: flatsurf/actions/show-logs@main | |
if: ${{ always() }} | |
test-pyeantic: | |
runs-on: ${{ matrix.on }} | |
strategy: | |
matrix: | |
include: | |
- on: ubuntu-22.04 | |
# SageMath 9.2 shipped with Python 3.8 so we test that this combination works. | |
python: "3.8" | |
sagelib: "9.2" | |
- on: ubuntu-22.04 | |
# SageMath 9.3 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.3" | |
- on: ubuntu-22.04 | |
# SageMath 9.4 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.4" | |
- on: ubuntu-22.04 | |
# SageMath 9.5 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.5" | |
- on: ubuntu-22.04 | |
# SageMath 9.6 shipped with Python 3.10 so we test that this combination works. | |
python: "3.10" | |
sagelib: "9.6" | |
- on: ubuntu-22.04 | |
# SageMath 9.7 shipped with Python 3.10 so we test that this combination works. | |
python: "3.10" | |
sagelib: "9.7" | |
- on: ubuntu-22.04 | |
# SageMath 9.8 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "9.8" | |
- on: ubuntu-22.04 | |
# SageMath 10.0 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.0" | |
- on: ubuntu-22.04 | |
# SageMath 10.1 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.1" | |
- on: ubuntu-22.04 | |
# SageMath 10.2 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.2" | |
- on: macos-11 | |
# SageMath 9.2 shipped with Python 3.8 so we test that this combination works. | |
python: "3.8" | |
sagelib: "9.2" | |
- on: macos-11 | |
# SageMath 9.3 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.3" | |
- on: macos-11 | |
# SageMath 9.4 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.4" | |
- on: macos-11 | |
# SageMath 9.5 shipped with Python 3.9 so we test that this combination works. | |
python: "3.9" | |
sagelib: "9.5" | |
- on: macos-11 | |
# We test the latest SageMath with the latest Python. | |
python: "3.10" | |
sagelib: "9.6" | |
- on: macos-11 | |
# SageMath 9.6 shipped with Python 3.10 so we test that this combination works. | |
python: "3.10" | |
sagelib: "9.6" | |
- on: macos-11 | |
# SageMath 9.7 shipped with Python 3.10 so we test that this combination works. | |
python: "3.10" | |
sagelib: "9.7" | |
- on: macos-11 | |
# SageMath 9.8 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "9.8" | |
- on: macos-11 | |
# SageMath 10.0 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.0" | |
- on: macos-11 | |
# SageMath 10.1 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.1" | |
- on: macos-11 | |
# SageMath 10.2 shipped with Python 3.11 so we test that this combination works. | |
python: "3.11" | |
sagelib: "10.2" | |
- on: ubuntu-22.04 | |
python: "3.11" | |
sagelib: "10.2" | |
sanitizer: valgrind | |
# Needs libsanitizer=11, with the default sanitizer, we get "ASan is ignoring requested __asan_handle_no_return" when importing SageMath and then fail to find the roots of some polynomials. | |
# - on: ubuntu-20.04 | |
# python: "3.9" | |
# sanitizer: address | |
# libtool strips -shared-asan which is required in LDFLAGS to load asan at runtime when building with clang | |
# - on: macos-11 | |
# python: "3.9" | |
# sanitizer: address | |
# Produces a mysterious "TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object" in cysignals | |
# - on: ubuntu-22.04 | |
# python: "3.10" | |
# sagelib: "9.6" | |
# sanitizer: undefined | |
# Produces a mysterious "TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object" in cysignals | |
# - on: macos-11 | |
# python: "3.10" | |
# sagelib: "9.6" | |
# sanitizer: undefined | |
steps: | |
- uses: actions/checkout@v2 | |
with: { submodules: recursive } | |
- name: build flags | |
id: flags | |
run: | | |
echo "::set-output name=configure::"`[[ ${{ runner.os }} == "Linux" ]] && echo "--with-version-script"` `[[ '${{ matrix.environment }}' == "binder" ]] && echo "--without-sage"` `[[ "${{ matrix.sanitizer }}" == "valgrind" ]] && echo "--enable-valgrind"` | |
echo "::set-output name=shared::"`[[ "${{ matrix.sanitizer }}" == "address" ]] && echo "-fsanitize=address -fno-sanitize-recover -fno-omit-frame-pointer"` `[[ "${{ matrix.sanitizer }}" == "undefined" ]] && echo "-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"` | |
echo "::set-output name=linker::"`[[ "${{ matrix.sanitizer }}" == "address" ]] && echo "-fsanitize=address"` `[[ "${{ matrix.sanitizer }}" == "undefined" ]] && echo "-fsanitize=undefined"` | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest", python-version: "${{ matrix.python }}" } | |
- name: install valgrind | |
shell: bash -l {0} | |
run: | | |
sudo apt update | |
sudo apt install -y libc6-dbg | |
mamba install valgrind | |
if: ${{ matrix.sanitizer == 'valgrind' }} | |
- name: install dependencies | |
shell: bash -l {0} | |
run: | | |
mamba install -n test sagelib=${{ matrix.sagelib }} | |
echo "sagelib ==${{ matrix.sagelib }}" >> $CONDA_PREFIX/conda-meta/pinned | |
mamba env update --quiet -n test -f libeantic/environment-flint2.yml | |
mamba env update --quiet -n test -f pyeantic/environment.yml | |
conda list | |
if: ${{ matrix.environment != 'binder' }} | |
- name: Create binder environment | |
shell: bash -l {0} | |
run: | | |
wget -O repo2docker.yml https://github.com/jupyterhub/repo2docker/raw/main/repo2docker/buildpacks/conda/environment.yml | |
mamba install -n test --quiet -y pytest pytest-xdist byexample | |
mamba env update -n test --quiet -f repo2docker.yml | |
mamba env update -n test --quiet -f binder/environment.yml | |
conda list | |
if: ${{ matrix.environment == 'binder' }} | |
- name: make ${{ matrix.target }} | |
shell: bash -l {0} | |
run: | | |
echo "::group::bootstrap" | |
./bootstrap | |
echo "::group::configure" | |
export CFLAGS="$CFLAGS -UNDEBUG -g3 ${{ steps.flags.outputs.shared }}" | |
export CXXFLAGS="$CXXFLAGS -UNDEBUG -g3 -fvisibility=hidden -fvisibility-inlines-hidden ${{ steps.flags.outputs.shared }}" | |
export LDFLAGS="$LDFLAGS ${{ steps.flags.outputs.shared }} ${{ steps.flags.outputs.linker }}" | |
if [[ "${{ matrix.sanitizer }}" == "address" || "${{ matrix.sanitizer }}" == "undefined" ]]; then | |
# Since our application (python) was not build with asan, we need to preload it explicitly. | |
export EANTIC_LD_PRELOAD=$(gcc -print-file-name=libasan.so) | |
export EANTIC_DYLD_INSERT_LIBRARIES=$(clang -print-file-name=libclang_rt.asan_osx_dynamic.dylib) | |
# Leak detection reports too many false positives in Python; they disabled it in their CI actually. | |
export ASAN_OPTIONS=detect_leaks=0 | |
# https://bitbucket.org/wlav/cppyy/issues/367/address-sanitizer-reports-a-alloc-dealloc | |
export ASAN_OPTIONS="$ASAN_OPTIONS:alloc_dealloc_mismatch=0" | |
fi | |
./configure --without-benchmark ${{ steps.flags.outputs.configure }} --without-doc | |
echo "::group::make" | |
make V=1 | |
echo "::group::test" | |
cd pyeantic | |
make V=1 `[[ "${{ matrix.sanitizer }}" == "valgrind" ]] && echo check-valgrind || echo check` | |
- uses: flatsurf/actions/show-logs@main | |
if: ${{ always() }} | |
distcheck: | |
runs-on: ${{ matrix.on }} | |
strategy: | |
matrix: | |
on: | |
- ubuntu-22.04 | |
# standardese 0.6.0 has not been released for macOS yet. | |
# - macos-11 | |
steps: | |
- uses: actions/checkout@v2 | |
with: { submodules: recursive } | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest", python-version: "3.10" } | |
- name: install dependencies | |
shell: bash -l {0} | |
run: | | |
mamba env update --quiet -n test -f doc/environment.yml | |
mamba env update --quiet -n test -f libeantic/environment.yml | |
mamba env update --quiet -n test -f pyeantic/environment.yml | |
conda list | |
- name: make distcheck | |
shell: bash -l {0} | |
run: | | |
echo "::group::bootstrap" | |
./bootstrap | |
echo "::group::configure" | |
./configure | |
echo "::group::make distcheck" | |
EXTRA_STANDARDESE_FLAGS=-I${CONDA_PREFIX}/include make distcheck | |
- uses: flatsurf/actions/show-logs@main | |
if: ${{ always() }} | |
env: | |
MAKEFLAGS: -j2 |