From 5444a13c39f7fa4043fe8dcc99ce35577bb0bdc6 Mon Sep 17 00:00:00 2001 From: dengemann Date: Fri, 22 Mar 2024 15:30:55 +0100 Subject: [PATCH] fix CI it/5 --- .github/workflows/test.yaml | 92 ++----------------------------------- 1 file changed, 5 insertions(+), 87 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6cdf62b..ca5ba86 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,96 +1,14 @@ name: CI on: [workflow_dispatch, pull_request, push] -permissions: - contents: read - -inputs: - pre: - description: 'Install prerelease nbdev/execnb from master?' - required: false - default: '' - version: - description: 'Version of python to set up' - required: false - default: '3.9' - skip_test: - description: 'Skip tests?' - required: false - default: '' - flags: - description: 'Space separated list of nbdev test flags to run that are normally ignored' - required: false - default: '' - torch_cpu: - description: "Install PyTorch CPU instead of PyTorch Cuda. Has no effect if PyTorch isn't a requirement. Enabled by defaut." - required: false - default: true - jobs: test: - name: nbdev-ci - using: composite runs-on: ubuntu-latest - defaults: - run: - shell: bash -el {0} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.version }} - cache: pip - cache-dependency-path: settings.ini - - name: Test with nbdev - env: - USE_PRE: ${{ inputs.pre }} - SKIP_TEST: ${{ inputs.skip_test }} - FLAGS: ${{ inputs.flags }} - TORCH_CPU: "${{ inputs.torch_cpu }}" - shell: bash - - run: | - set -ux - python -m pip install --upgrade pip - if [ $USE_PRE ]; then - pip install -U git+https://github.com/fastai/fastcore.git - pip install -U git+https://github.com/fastai/ghapi.git - pip install -U git+https://github.com/fastai/execnb.git - pip install -U git+https://github.com/fastai/nbdev.git - else - pip install -U nbdev - fi - echo "Doing editable install..." - if [ $TORCH_CPU ]; then - test -f setup.py && pip install -e ".[dev]" --extra-index-url https://download.pytorch.org/whl/cpu - else - test -f setup.py && pip install -e ".[dev]" - fi - echo "Check we are starting with clean git checkout" - if [[ `git status --porcelain -uno` ]]; then - git diff - echo "git status is not clean" - false - fi - echo "Trying to strip out notebooks" - nbdev_clean - echo "Check that strip out was unnecessary" - git status -s # display the status to see which nbs need cleaning up - if [[ `git status --porcelain -uno` ]]; then - git status -uno - echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_hooks" - echo -e "This error can also happen if you are using an older version of nbdev relative to what is in CI. Please try to upgrade nbdev with the command `pip install -U nbdev`" - false - fi - nbdev_export - if [[ `git status --porcelain -uno` ]]; then - echo "::error::Notebooks and library are not in sync. Please run nbdev_export." - git status -uno - git diff - exit 1; - fi - echo "Making sure MNE data dependencies are downloaded" + - uses: actions/checkout@v3 # Check out the code + - name: Install Dependencies + run: | + pip install mne[data]>= 1.3 python -c 'import mne; mne.datasets.sample.data_path(verbose=True)'; python -c 'import mne; mne.datasets.testing.data_path(verbose=True)'; - if [ ! $SKIP_TEST ]; then - nbdev_test --flags "$FLAGS" - fi \ No newline at end of file + - uses: fastai/workflows/nbdev-ci@master \ No newline at end of file