Skip to content

Commit

Permalink
try lighter test run for PRs?
Browse files Browse the repository at this point in the history
  • Loading branch information
Marmaduke Woodman committed May 31, 2024
1 parent 018c435 commit 73ebdfb
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push]
jobs:
build:
name: Test and Inspect
if: github.repository == 'the-virtual-brain/tvb-root'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -88,3 +89,67 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

# use lighter version for PRs
build_pr:
name: Test and Inspect PR
if: github.repository != 'the-virtual-brain/tvb-root'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: set up Python 3.10
uses: actions/setup-python@v4
id: setPy
with:
python-version: 3.10

- name: put ~/.local/bin on $PATH
run: echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV

- name: install tools and dependencies
run: |
sudo apt-get update
sudo apt install libbz2-dev libhdf5-serial-dev liblzo2-dev
python3 -m pip install --upgrade setuptools==59.8.0 pip wheel
pip3 install --user --upgrade numpy
python3 -m pip install scikit-build
pip3 install --user -r tvb_framework/requirements.txt
pip3 install --user --no-build-isolation tvb-gdist
- name: setup tvb
run: |
cd tvb_build
bash install_full_tvb.sh
- name: cache data
id: cache-data
uses: actions/cache@v3
with:
path: tvb_data
key: tvb-data

- name: download data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
wget -q https://zenodo.org/record/10128131/files/tvb_data.zip?download=1 -O tvb_data.zip
mkdir tvb_data
unzip tvb_data.zip -d tvb_data
rm tvb_data.zip
- name: setup data
run: |
cd tvb_data
python3 setup.py develop
- name: run library tests
run: pytest -v tvb_library --cov --cov-report=xml && mv coverage.xml coverage-library.xml

- name: run framework tests
run: pytest -v tvb_framework --cov --cov-report=xml --ignore=tvb_framework/tvb/interfaces/rest/client/tests/rest_test.py && mv coverage.xml coverage-framework.xml

- name: run storage tests
run: pytest -v tvb_storage --cov --cov-report=xml && mv coverage.xml coverage-storage.xml

0 comments on commit 73ebdfb

Please sign in to comment.