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,26 +293,57 @@ 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
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install System packages
run: | run: |
whoami && echo PWD=$PWD && echo HOME=$HOME && echo SPACK_TEST_SOLVER=$SPACK_TEST_SOLVER sudo apt-get -y update
python3 -c "import clingo; print(hasattr(clingo.Symbol, '_rep'), clingo.__version__)" # Needed for unit tests
git clone https://github.com/spack/spack.git && cd spack sudo apt-get install -y coreutils gfortran graphviz gnupg2 mercurial
git fetch origin ${{ github.ref }}:test-branch sudo apt-get install -y ninja-build patchelf
git checkout test-branch # Needed for kcov
. share/spack/setup-env.sh sudo apt-get -y install cmake binutils-dev libcurl4-openssl-dev
spack compiler find sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev
spack solve mpileaks%gcc - name: Install kcov for bash script coverage
if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ] if: ${{ needs.changes.outputs.with_coverage == 'true' }}
then env:
coverage run $(which spack) unit-test -v -x KCOV_VERSION: 34
run: |
KCOV_ROOT=$(mktemp -d)
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 combine
coverage xml coverage xml
else - name: Run unit tests (reduced suite without coverage)
$(which spack) unit-test -m "not maybeslow" -k "package_sanity" if: ${{ needs.changes.outputs.with_coverage == 'false' }}
fi env:
ONLY_PACKAGES: true
SPACK_TEST_SOLVER: clingo
run: |
share/spack/qa/run-unit-tests
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1
if: ${{ needs.changes.outputs.with_coverage == 'true' }} if: ${{ needs.changes.outputs.with_coverage == 'true' }}
with: with: