Skip to content

pytest

pytest #2065

Workflow file for this run

name: pytest
on:
# Every push
push:
# When requested manually
workflow_dispatch:
# Every morning at 3am -- how does it know which branch to run??
schedule:
- cron: '0 3 * * *'
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Pull and run docker 🐋
shell: bash
run: |
docker pull stanfordaha/garnet:latest
docker run -d -it --name CONTAINER stanfordaha/garnet:latest bash
docker exec CONTAINER /bin/bash -c "rm -rf /aha/garnet"
docker exec CONTAINER /bin/bash -c "source /aha/bin/activate; pip install psutil"
docker cp ../garnet CONTAINER:/aha/garnet
- name: Run tests ⚙️
shell: bash
run: |
docker exec -i CONTAINER bash -c "/aha/garnet/.github/scripts/run_pytest.sh"
- name: Upload Coverage
shell: bash
# CODECOV_TOKEN secret stored at https://github.com/StanfordAHA/garnet/settings/secrets/actions
run: |
docker exec -i CONTAINER bash -c "cd /aha/garnet/ && bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}"