Skip to content

Commit

Permalink
Use push action for codecov
Browse files Browse the repository at this point in the history
As per codecov/codecov-bash#83
codecov has issues with github actions triggered by pullrequest.
To remedy the situation, we use push as a trigger instead.
  • Loading branch information
eivindjahren committed May 30, 2022
1 parent d594604 commit 1e12cca
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
15 changes: 1 addition & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Build libres
run: |
mkdir cmake-build
cmake -S libres -B cmake-build -DBUILD_TESTS=ON -DCOVERAGE=ON
cmake -S libres -B cmake-build -DBUILD_TESTS=ON
cmake --build cmake-build
- name: Run tests
Expand All @@ -56,19 +56,6 @@ jobs:
export PATH=$PWD/bin:$PATH
ctest --output-on-failure
- name: Install gcovr
run: |
python3 -m pip install gcovr
- name: generate coverage report
run: |
gcovr -r libres/ --exclude-directories ".*tests" cmake-build/ --xml -o cov.xml
- name: Upload c coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: cov.xml
build-wheels:
timeout-minutes: 30
Expand Down
41 changes: 30 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Python coverage
name: coverage

on:
push:
branches:
- main
- 'version-**'
tags: "*"
pull_request:
on: [push]

env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1

jobs:
python-test-coverage:
Expand All @@ -15,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
system-under-test: ['res', 'ert']
system-under-test: ['res', 'ert', 'libres']
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -30,7 +28,9 @@ jobs:
with:
python-version: '3.9'

- name: Install with dependencies

- name: Install pip package with dependencies
if: matrix.system-under-test == 'ert' || matrix.system-under-test == 'res'
run: |
pip install .
pip install -r dev-requirements.txt
Expand All @@ -54,7 +54,26 @@ jobs:
cd tests
pytest libres_tests --cov=res --cov-report=xml:cov.xml
- name: Upload python coverage to Codecov
- name: Run libres tests
if: matrix.system-under-test == 'libres'
run: |
sudo apt-get install -y valgrind
python3 -m pip install conan
git clone https://github.com/equinor/libecl
mkdir libecl/build
cmake -S libecl -B libecl/build -DCMAKE_BUILD_TYPE=RelWithDebInfo
sudo cmake --build libecl/build --target install
sudo rm -rf libecl
mkdir cmake-build
cmake -S libres -B cmake-build -DBUILD_TESTS=ON -DCOVERAGE=ON
cmake --build cmake-build
cd cmake-build
export PATH=$PWD/bin:$PATH
ctest --output-on-failure
python3 -m pip install gcovr
gcovr -r libres/ --exclude-directories ".*tests" cmake-build/ --xml -o tests/cov.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit 1e12cca

Please sign in to comment.