From 03ad32176b57adc22292c179f6c213299b963783 Mon Sep 17 00:00:00 2001 From: umarcor Date: Fri, 8 Jan 2021 15:45:54 +0100 Subject: ci/coverage: publish coverage report at CodeCov and Codacy --- .github/workflows/push.yml | 75 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 17 deletions(-) (limited to '.github') diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5591b9c81..61de5de9e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -124,12 +124,12 @@ jobs: max-parallel: 2 matrix: include: [ - {installs: "MINGW32", arch: i686, pkg: "mcode"}, - #{installs: "MINGW32", arch: i686, pkg: "llvm"}, ! Not yet functional - #{installs: "MINGW64", arch: x86_64, pkg: "mcode"}, ! mcode is not yet supported on win64 - {installs: "MINGW64", arch: x86_64, pkg: "llvm"}, + {icon: '馃煢', installs: 'MINGW32', arch: i686, pkg: 'mcode' }, + #{icon: '馃煢', installs: "MINGW32", arch: i686, pkg: "llvm" }, ! Not yet functional + #{icon: '馃煪', installs: "MINGW64", arch: x86_64, pkg: "mcode" }, ! mcode is not yet supported on win64 + {icon: '馃煪', installs: 'MINGW64', arch: x86_64, pkg: 'llvm' }, ] - name: '馃煪 Build 路 ${{ matrix.installs }} 路 ${{ matrix.pkg }}' + name: '${{ matrix.icon }} Build 路 ${{ matrix.installs }} 路 ${{ matrix.pkg }}' env: MINGW_INSTALLS: ${{ matrix.installs }} defaults: @@ -137,7 +137,7 @@ jobs: shell: msys2 {0} steps: - - name: '馃煪 Setup MSYS2' + - name: '${{ matrix.icon }} Setup MSYS2' uses: msys2/setup-msys2@v2 with: msystem: MSYS @@ -166,13 +166,13 @@ jobs: with: name: ${{ matrix.installs }}-${{ matrix.pkg }}-builddir path: | - ./scripts/msys2-${{ matrix.pkg }}/src/ - ./scripts/msys2-${{ matrix.pkg }}/pkg/ + scripts/msys2-${{ matrix.pkg }}/src/ + scripts/msys2-${{ matrix.pkg }}/pkg/ - name: '馃摛 Upload artifact: package' uses: actions/upload-artifact@v2 with: - path: ./scripts/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst + path: scripts/msys2-${{ matrix.pkg }}/mingw-*ghdl*.pkg.tar.zst # # Windows Test @@ -186,10 +186,10 @@ jobs: max-parallel: 8 matrix: sys: [ - {installs: "MINGW32", arch: i686, pkg: "mcode"}, - #{installs: "MINGW32", arch: i686, pkg: "llvm"}, ! Not yet functional - #{installs: "MINGW64", arch: x86_64, pkg: "mcode"}, ! mcode is not yet supported on win64 - {installs: "MINGW64", arch: x86_64, pkg: "llvm"}, + {icon: '馃煢', installs: 'MINGW32', arch: i686, pkg: 'mcode' }, + #{icon: '馃煢', installs: "MINGW32", arch: i686, pkg: "llvm" }, ! Not yet functional + #{icon: '馃煪', installs: "MINGW64", arch: x86_64, pkg: "mcode" }, ! mcode is not yet supported on win64 + {icon: '馃煪', installs: 'MINGW64', arch: x86_64, pkg: 'llvm' }, ] suite: [ 'sanity pyunit vpi', @@ -197,13 +197,13 @@ jobs: 'vests', 'synth', ] - name: '馃煪 Test 路 ${{ matrix.sys.installs }} 路 ${{ matrix.sys.pkg }} 路 ${{ matrix.suite }}' + name: '${{ matrix.sys.icon }} Test 路 ${{ matrix.sys.installs }} 路 ${{ matrix.sys.pkg }} 路 ${{ matrix.suite }}' defaults: run: shell: msys2 {0} steps: - - name: '馃煪 Setup MSYS2' + - name: '${{ matrix.sys.icon }} Setup MSYS2' uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.sys.installs }} @@ -264,7 +264,7 @@ jobs: coverage: needs: win-build runs-on: windows-latest - name: '馃煪 Coverage' + name: '馃搱 Coverage' defaults: run: shell: msys2 {0} @@ -292,7 +292,48 @@ jobs: pip3 install -r testsuite/requirements.txt - name: Run tests to generate coverage report - run: PYTHONPATH=$(pwd)/.. python3 -m pytest -rA --cov=.. --cov-config=.coveragerc testsuite/pyunit + run: | + PYTHONPATH=$(pwd)/.. python3 -m pytest -rA --cov=.. --cov-config=.coveragerc testsuite/pyunit + + - name: Generate XML coverage report + if: always() + run: coverage xml + + - name: '馃摛 Upload artifact: coverage report' + if: always() + uses: actions/upload-artifact@v2 + with: + name: coverage + path: coverage.xml + +# +# Coverage Publish (Ubuntu) +# + + coverage-publish: + needs: coverage + if: always() && github.repository == 'ghdl/ghdl' && github.event_name != 'pull_request' + runs-on: ubuntu-latest + name: '馃摦 Publish coverage report' + steps: + + - name: '馃摜 Download artifact: coverage report' + uses: actions/download-artifact@v2 + with: + name: coverage + + - name: CodeCov + uses: codecov/codecov-action@v1 + with: + file: coverage.xml + flags: unittests + env_vars: PYTHON + + - name: Codacy + uses: codacy/codacy-coverage-reporter-action@master + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: coverage.xml #--- -- cgit v1.2.3