Fix termination when saving long-named expressions in a pre-proc loop #289
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: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
# Simple tests on Linux; except the ParFORM case, they probably pass unless | |
# the committer has forgotten running "make check". | |
check: | |
name: Test (${{ matrix.test }}) for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {bin: form, test: default} | |
- {bin: tform, test: default} | |
- {bin: tform, test: default, nthreads: 2} | |
- {bin: parform, test: default, timeout: 15} | |
- {bin: form, test: checkpoint} | |
- {bin: tform, test: checkpoint} | |
- {bin: form, test: forcer, timeout: 60} | |
- {bin: tform, test: forcer, timeout: 60} | |
- {bin: tform, test: forcer, nthreads: 2, timeout: 60} | |
- {bin: tform, test: multithreaded} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # ensures a reachable tag | |
- name: Install MPFR | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: libmpfr-dev | |
version: 1.0 | |
- name: Install MPI if necessary | |
if: matrix.bin == 'parform' || matrix.bin == 'parvorm' | |
run: | | |
sudo apt update | |
sudo apt install -y -q libmpich-dev | |
- name: Configure | |
run: | | |
opts='--disable-dependency-tracking' | |
case ${{ matrix.bin }} in | |
form|vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";; | |
tform|tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";; | |
parform|parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";; | |
esac | |
case ${{ matrix.bin }} in | |
vorm|tvorm|parvorm) opts="$opts --enable-debug";; | |
esac | |
opts="$opts --with-gmp --with-zlib" | |
autoreconf -i | |
./configure $opts | |
- name: Build | |
run: make -C sources -j 4 ${{ matrix.bin }} | |
- name: Cache library | |
id: cache-formlib | |
if: contains(fromJson('["forcer"]'), matrix.test) | |
uses: actions/cache@v4 | |
with: | |
path: formlib | |
key: formlib-${{ matrix.test }} | |
- name: Install library if necessary | |
if: steps.cache-formlib.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p formlib | |
case ${{ matrix.test }} in | |
forcer) | |
wget https://github.com/benruijl/forcer/archive/v1.0.0.tar.gz -O - | tar -x --gzip | |
mv forcer-1.0.0/forcer.h formlib | |
mv forcer-1.0.0/forcer formlib | |
rm -rf forcer-1.0.0 | |
;; | |
esac | |
- name: Test | |
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }} ${{ matrix.timeout && format('--timeout {0}', matrix.timeout) || '' }} ${{ matrix.test != 'default' && format('-C {0}', matrix.test) || '' }} | |
env: | |
FORMPATH: ${{ github.workspace }}/formlib | |
# Check memory errors (e.g., uninitialized values and memory leaks) | |
# thoroughly by using Valgrind on Linux. To maximize the use of concurrent | |
# jobs, we divide the tests into smaller parts. | |
valgrind-check: | |
name: Valgrind check for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} (${{ matrix.group }}) | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {bin: vorm, group: 1/5} | |
- {bin: vorm, group: 2/5} | |
- {bin: vorm, group: 3/5} | |
- {bin: vorm, group: 4/5} | |
- {bin: vorm, group: 5/5} | |
- {bin: tvorm, group: 1/10} | |
- {bin: tvorm, group: 2/10} | |
- {bin: tvorm, group: 3/10} | |
- {bin: tvorm, group: 4/10} | |
- {bin: tvorm, group: 5/10} | |
- {bin: tvorm, group: 6/10} | |
- {bin: tvorm, group: 7/10} | |
- {bin: tvorm, group: 8/10} | |
- {bin: tvorm, group: 9/10} | |
- {bin: tvorm, group: 10/10} | |
- {bin: tvorm, nthreads: 2, group: 1/10} | |
- {bin: tvorm, nthreads: 2, group: 2/10} | |
- {bin: tvorm, nthreads: 2, group: 3/10} | |
- {bin: tvorm, nthreads: 2, group: 4/10} | |
- {bin: tvorm, nthreads: 2, group: 5/10} | |
- {bin: tvorm, nthreads: 2, group: 6/10} | |
- {bin: tvorm, nthreads: 2, group: 7/10} | |
- {bin: tvorm, nthreads: 2, group: 8/10} | |
- {bin: tvorm, nthreads: 2, group: 9/10} | |
- {bin: tvorm, nthreads: 2, group: 10/10} | |
- {bin: parvorm, group: 1/10} | |
- {bin: parvorm, group: 2/10} | |
- {bin: parvorm, group: 3/10} | |
- {bin: parvorm, group: 4/10} | |
- {bin: parvorm, group: 5/10} | |
- {bin: parvorm, group: 6/10} | |
- {bin: parvorm, group: 7/10} | |
- {bin: parvorm, group: 8/10} | |
- {bin: parvorm, group: 9/10} | |
- {bin: parvorm, group: 10/10} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # ensures a reachable tag | |
- name: Install Valgrind | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: valgrind | |
version: 1.0 | |
- name: Install MPFR | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: libmpfr-dev | |
version: 1.0 | |
- name: Install MPI if necessary | |
if: matrix.bin == 'parform' || matrix.bin == 'parvorm' | |
run: | | |
sudo apt update | |
sudo apt install -y -q libmpich-dev | |
- name: Configure | |
run: | | |
opts='--disable-dependency-tracking' | |
case ${{ matrix.bin }} in | |
form|vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";; | |
tform|tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";; | |
parform|parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";; | |
esac | |
case ${{ matrix.bin }} in | |
vorm|tvorm|parvorm) opts="$opts --enable-debug";; | |
esac | |
opts="$opts --with-gmp --with-zlib" | |
autoreconf -i | |
./configure $opts | |
- name: Build | |
run: make -C sources -j 4 ${{ matrix.bin }} | |
- name: Test | |
run: ./check/check.rb valgrind ./sources/${{ matrix.bin }} --stat -g ${{ matrix.group }} --retries 5 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }} | |
# Generate LCOV coverage data to be posted to coveralls.io. Note that | |
# we measure code coverage only for tests checked with Valgrind. | |
coverage: | |
name: Code coverage for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {bin: vorm} | |
- {bin: tvorm} | |
- {bin: tvorm, nthreads: 2} | |
- {bin: parvorm} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # ensures a reachable tag | |
- name: Install LCOV | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: lcov | |
version: 1.0 | |
- name: Install MPFR | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: libmpfr-dev | |
version: 1.0 | |
- name: Install MPI if necessary | |
if: matrix.bin == 'parform' || matrix.bin == 'parvorm' | |
run: | | |
sudo apt update | |
sudo apt install -y -q libmpich-dev | |
- name: Configure | |
run: | | |
opts='--disable-dependency-tracking' | |
case ${{ matrix.bin }} in | |
vorm) opts="$opts --enable-scalar --disable-threaded --disable-parform";; | |
tvorm) opts="$opts --disable-scalar --enable-threaded --disable-parform";; | |
parvorm) opts="$opts --disable-scalar --disable-threaded --enable-parform";; | |
esac | |
opts="$opts --enable-debug --enable-coverage --with-gmp --with-zlib" | |
autoreconf -i | |
./configure $opts | |
- name: Build | |
run: make -C sources -j 4 ${{ matrix.bin }} | |
- name: Test | |
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat --timeout 30 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }} | |
- name: Generate LCOV coverage data | |
run: | | |
lcov -d . -c -o coverage.lcov | |
lcov -r coverage.lcov */usr/include/* -o coverage.lcov | |
- name: Coveralls Parallel | |
uses: coverallsapp/github-action@v2 | |
with: | |
flag-name: ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} | |
parallel: true | |
# Post LCOV coverage data to coveralls.io. | |
coverage-finish: | |
needs: [check, valgrind-check, coverage] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: coverallsapp/github-action@v2 | |
with: | |
parallel-finished: true | |
# Tests with a 32-bit container. | |
check-i386: | |
name: 32-bit container check for ${{ matrix.bin }}${{ matrix.nthreads && format(' -w{0}', matrix.nthreads) || '' }} | |
runs-on: ubuntu-latest | |
container: | |
image: i386/debian:11.5 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- {bin: form} | |
- {bin: tform} | |
- {bin: tform, nthreads: 2} | |
steps: | |
# We have to use v1. | |
# See https://github.com/actions/checkout/issues/334 | |
- name: Checkout repository | |
uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get -y install automake build-essential git libgmp-dev libmpfr-dev ruby zlib1g-dev | |
- name: Configure | |
run: | | |
opts='--disable-dependency-tracking' | |
case ${{ matrix.bin }} in | |
form) opts="$opts --enable-scalar --disable-threaded --disable-parform";; | |
tform) opts="$opts --disable-scalar --enable-threaded --disable-parform";; | |
esac | |
opts="$opts --disable-debug --with-gmp --with-zlib" | |
autoreconf -i | |
./configure $opts | |
- name: Build | |
run: make -C sources -j 4 ${{ matrix.bin }} | |
- name: Test | |
run: ./check/check.rb ./sources/${{ matrix.bin }} --stat --wordsize 2 ${{ matrix.nthreads && format('-w{0}', matrix.nthreads) || '' }} |