Skip to content

Ability to resume workflow when codecov push fails #78

Ability to resume workflow when codecov push fails

Ability to resume workflow when codecov push fails #78

Workflow file for this run

name: Scilpy test suite
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
MPLBACKEND: agg
OPENBLAS_NUM_THREADS: 1
jobs:
test:
runs-on: scilus-runners
if: github.repository == 'scilus/scilpy'
steps:
# If this runs and does not fails, its because the workflow was relaunched
# with no resuming and we need to delete the artifact since we
# re-executed the tests. Else, if nothing to do, it'll fail the job
# (silently) and the remaining workflow will continue
- name: Delete tests and coverage artifact
uses: geekyeggo/delete-artifact@v4
with:
name: test-coverage-${{ github.run_id }}
failOnError: false
- name: Checkout repository for merge
uses: actions/checkout@v4
- name: Fetch python version from repository
id: python-selector
run: echo "python-version=$(cat .python-version)" >> $GITHUB_OUTPUT
- name: Set up Python for Scilpy
uses: actions/[email protected]
with:
python-version: ${{ steps.python-selector.outputs.python-version }}
cache: 'pip'
- name: Install non-python dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
git \
libblas-dev \
liblapack-dev \
libfreetype6-dev
- name: Install Scilpy
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
- name: Run tests
run: |
export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH
pytest --cov-report term-missing:skip-covered
- name: Save test results and coverage
uses: actions/upload-artifact@v4
id: test-coverage-results
with:
name: test-coverage-${{ github.run_id }}
path: |
.coverage
.test_reports/
coverage:
runs-on: scilus-runners
if: github.repository == 'scilus/scilpy'
needs: test
steps:
- name: Checkout repository for merge
uses: actions/checkout@v4
- name: Download test results and coverage
uses: actions/download-artifact@v4
with:
name: test-coverage-${{ github.run_id }}
- name: Show the content of the workspace where we upload
run: |
echo "what is here : $(pwd)"
ls -lha .
echo "what is in GITHUB_WORKSPACE : $GITHUB_WORKSPACE"
ls -lha $GITHUB_WORKSPACE
echo "what is in github.workspace : ${{ github.workspace }}"
ls -lha ${{ github.workspace }}
exit 1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: scilpy-unittests-${{ github.run_id }}
verbose: true
fail_ci_if_error: true
plugin: pycoverage
- name: Delete tests and coverage artifact
uses: geekyeggo/delete-artifact@v4
if: success()
with:
name: test-coverage-${{ github.run_id }}
failOnError: false