diff --git a/.github/workflows/ci-scripts.yml b/.github/workflows/ci-scripts.yml index 437113b3..62dedbc9 100644 --- a/.github/workflows/ci-scripts.yml +++ b/.github/workflows/ci-scripts.yml @@ -1,5 +1,10 @@ name: ADCore +# Cancel in-progress runs of this workflow when a new run is triggered on the same pull request or branch +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + # Trigger on pushes and PRs to any branch on: push: @@ -43,6 +48,18 @@ jobs: deps: os test: true + # Use linux/adsupport/shared case for coverage check + - os: ubuntu-latest + cmp: gcc + configuration: default + base: "7.0" + deps: adsupport + extra: "CMD_CFLAGS='--coverage' + CMD_CXXFLAGS='--coverage' + CMD_LDFLAGS='--coverage'" + test: true + coverage: true + - os: ubuntu-latest cmp: gcc configuration: static @@ -85,17 +102,21 @@ jobs: with: submodules: true - - name: "Install TIRPC Headers" + - name: Install TIRPC Headers if: runner.os == 'Linux' run: sudo apt-get install -y libtirpc-dev - - name: "Install Linux OS Deps" + - name: Install boost packages for unit tests + if: ${{ runner.os == 'Linux' }} + run: sudo apt-get install -y libboost-test-dev libboost-system-dev + + - name: Install Linux OS Deps if: ${{ matrix.deps == 'os' && runner.os == 'Linux' }} run: | sudo apt-get update sudo apt-get -y install \ libgraphicsmagick++-dev libhdf5-dev libjpeg-dev libnetcdf-dev libtiff-dev libxml2-dev libz-dev \ - libblosc-dev libnexus-dev libnetcdf-dev libusb-1.0-0-dev libboost-test-dev libboost-system-dev + libblosc-dev libnexus-dev libnetcdf-dev libusb-1.0-0-dev cat < configure/CONFIG_SITE.linux-x86_64.Common WITH_PVA=YES @@ -140,13 +161,14 @@ jobs: - name: Prepare and compile EPICS dependencies run: python .ci/cue.py prepare - - name: "Configure ADSupport Deps" + - name: Configure ADSupport Deps if: ${{ matrix.deps == 'adsupport' }} shell: bash run: | cat <> configure/CONFIG_SITE WITH_PVA=YES - WITH_BOOST=NO + WITH_BOOST=${{ (runner.os == 'Linux' && matrix.test) && 'YES' || 'NO' }} + BOOST_EXTERNAL=YES WITH_HDF5=YES HDF5_EXTERNAL=NO XML2_EXTERNAL=NO @@ -176,3 +198,19 @@ jobs: if: ${{ matrix.test }} shell: bash run: ./bin/*/plugin-test + + - name: Generate coverage report + if: ${{ matrix.coverage }} + run: | + sudo apt-get -y install lcov + lcov --no-external --capture \ + --directory ADApp/ADSrc/ \ + --directory ADApp/pluginSrc/ \ + --output-file ci/coverage.info + + - name: Upload to Coveralls + if: ${{ matrix.coverage }} + uses: coverallsapp/github-action@v2 + with: + file: ci/coverage.info + format: lcov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2df0f728..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -sudo: required -language: cpp -compiler: gcc -env: -- EPICS_HOST_ARCH=linux-x86_64 -before_install: -- bash ci/install-packages.sh -install: -- make -script: -- "valgrind --leak-check=yes --log-file=valgrind_output.txt ./bin/linux-x86_64/plugin-test --log_level=test_suite" -after_success: -- sh ci/coverage.sh -- coveralls-lcov --source-encoding=ISO-8859-1 ci/coverage.info -- tail --lines 15 valgrind_output.txt -notifications: - slack: epicsareadetector:xf0ac8PfwqcSqi2gE0tUcUkP