Skip to content

Updated the Run Test workflow #2305

Updated the Run Test workflow

Updated the Run Test workflow #2305

Workflow file for this run

name: Run Tests
on: [push, pull_request]
jobs:
build-images:
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [sacher]
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v5
with:
context: .
tags: simurlacra:test
cache-from: type=registry,ref=simurlacra:test
cache-to: type=inline
load: true
build-args: |
OPTION=${{ matrix.flavor }}
- name: Execute tests
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
export COVPATH=$(realpath .)
docker run --rm -i -v $COVPATH:/cov simurlacra:test bash -c "pytest Pyrado --cov=./Pyrado --cov-report=xml --verbose -n 2 -m 'not visual'; sudo cp ./coverage.xml /cov"
sudo mkdir /home/user/
sudo mkdir /home/user/SimuRLacra
sudo ln -s $COVPATH /home/user/SimuRLacra
echo $COVPATH
ls $COVPATH
cd Pyrado
pwd
ls
- name: Send Coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: coverage.xml # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true
- name: Test & publish code coverage
uses: paambaati/[email protected]
if: ${{ github.repository_owner == 'famura' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
workingDirectory: Pyrado
coverageLocations: |
${{ github.workspace }}/coverage.xml:cobertura
debug: true
prefix: /home/user/SimuRLacra/