qa: install clingo-cffi from pip (#23163)

Clingo has been released on PyPI, so there
are no more concerns on our CI depending
on pypy.test for installing the wheel.

Apparently we have parts of Spack which
are not compatible with kcov > 3.4
This commit is contained in:
Massimiliano Culpo 2021-04-22 09:35:17 +02:00 committed by GitHub
parent 7322a9e3be
commit 46088aa5da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,30 +293,61 @@ jobs:
clingo-cffi: clingo-cffi:
needs: [ validate, style, documentation, changes ] needs: [ validate, style, documentation, changes ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: spack/github-actions:clingo-cffi
steps: steps:
- name: Run unit tests - uses: actions/checkout@v2
run: | with:
whoami && echo PWD=$PWD && echo HOME=$HOME && echo SPACK_TEST_SOLVER=$SPACK_TEST_SOLVER fetch-depth: 0
python3 -c "import clingo; print(hasattr(clingo.Symbol, '_rep'), clingo.__version__)" - uses: actions/setup-python@v2
git clone https://github.com/spack/spack.git && cd spack with:
git fetch origin ${{ github.ref }}:test-branch python-version: 3.9
git checkout test-branch - name: Install System packages
. share/spack/setup-env.sh run: |
spack compiler find sudo apt-get -y update
spack solve mpileaks%gcc # Needed for unit tests
if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ] sudo apt-get install -y coreutils gfortran graphviz gnupg2 mercurial
then sudo apt-get install -y ninja-build patchelf
coverage run $(which spack) unit-test -v -x # Needed for kcov
coverage combine sudo apt-get -y install cmake binutils-dev libcurl4-openssl-dev
coverage xml sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev
else - name: Install kcov for bash script coverage
$(which spack) unit-test -m "not maybeslow" -k "package_sanity" if: ${{ needs.changes.outputs.with_coverage == 'true' }}
fi env:
- uses: codecov/codecov-action@v1 KCOV_VERSION: 34
if: ${{ needs.changes.outputs.with_coverage == 'true' }} run: |
with: KCOV_ROOT=$(mktemp -d)
flags: unittests,linux,clingo wget --output-document=${KCOV_ROOT}/${KCOV_VERSION}.tar.gz https://github.com/SimonKagstrom/kcov/archive/v${KCOV_VERSION}.tar.gz
tar -C ${KCOV_ROOT} -xzvf ${KCOV_ROOT}/${KCOV_VERSION}.tar.gz
mkdir -p ${KCOV_ROOT}/build
cd ${KCOV_ROOT}/build && cmake -Wno-dev ${KCOV_ROOT}/kcov-${KCOV_VERSION} && cd -
make -C ${KCOV_ROOT}/build && sudo make -C ${KCOV_ROOT}/build install
- name: Install Python packages
run: |
pip install --upgrade pip six setuptools codecov coverage clingo
- name: Setup git configuration
run: |
# Need this for the git tests to succeed.
git --version
. .github/workflows/setup_git.sh
- name: Run unit tests (full suite with coverage)
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
env:
COVERAGE: true
SPACK_TEST_SOLVER: clingo
run: |
share/spack/qa/run-unit-tests
coverage combine
coverage xml
- name: Run unit tests (reduced suite without coverage)
if: ${{ needs.changes.outputs.with_coverage == 'false' }}
env:
ONLY_PACKAGES: true
SPACK_TEST_SOLVER: clingo
run: |
share/spack/qa/run-unit-tests
- uses: codecov/codecov-action@v1
if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with:
flags: unittests,linux,clingo
# Run unit tests on MacOS # Run unit tests on MacOS
build: build:
needs: [ validate, style, documentation, changes ] needs: [ validate, style, documentation, changes ]