8000 moved download of task template into separate job to avoid issues wit… by tclose · Pull Request #19 · nipype/nipype2pydra · GitHub
[go: up one dir, main page]

Skip to content

moved download of task template into separate job to avoid issues wit… #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension 8000


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
moved download of task template into separate job to avoid issues wit…
…hin tests
  • Loading branch information
tclose committed May 17, 2024
commit 91cd4e5682a6290d15f6d57ee4cc75fc0c4af8c9
27 changes: 26 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ defaults:
shell: bash

jobs:

download-task-template:
runs-on: ubuntu-latest
steps:

- name: Download task template
run: |
LATEST=$(curl -s https://api.github.com/repos/nipype/pydra-tasks-template/releases/latest | grep tag_name | awk -F\" '{print $4}')
curl -Lo pydra-task-template.tar.gz https://github.com/nipype/pydra-tasks-template/archive/refs/tags/$LATEST.tar.gz
tar xzf pydra-task-template.tar.gz
mv pydra-tasks-template-* pydra-tasks-template

- uses: actions/upload-artifact@v4
with:
name: tasks-template
path: pydra-tasks-template

test:
strategy:
matrix:
Expand All @@ -28,6 +45,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Download the pydra-tasks-template artefact
uses: actions/download-artifact@v4
with:
name: pydra-tasks-template
path: $HOME/pydra-tasks-template

- name: Unset header
# checkout@v2 adds a header that makes branch protection report errors
# because the Github action bot is not a collaborator on the repo
Expand Down Expand Up @@ -64,7 +87,9 @@ jobs:
run: python3 -m pip install --break-system-packages .[test]

- name: Pytest
run: pytest -vvs --cov nipype2pydra --cov-config .coveragerc --cov-report xml
run: >-
NIPYPE2PYDRA_PYDRA_TASK_TEMPLATE=$HOME/pydra-tasks-template
pytest -vvs --cov nipype2pydra --cov-config .coveragerc --cov-report xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
8 changes: 8 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ def invoke(*args, catch_exceptions=catch_cli_exceptions, **kwargs):
return invoke


@pytest.fixture
def tasks_template_args():
template = os.environ.get("NIPYPE2PYDRA_PYDRA_TASK_TEMPLATE", None)
if template:
return ["--task-template", template]
return []


# For debugging in IDE's don't catch raised exceptions and let the IDE
# break at it
if os.getenv("_PYTEST_RAISE", "0") != "0":
Expand Down
5 changes: 3 additions & 2 deletions nipype2pydra/pkg_gen/tests/test_pkg_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def pkg_gen_spec_file(request):
return EXAMPLE_PKG_GEN_DIR.joinpath(*request.param.split("-")).with_suffix(".yaml")


def test_pkg_gen(pkg_gen_spec_file, cli_runner, tmp_path):
def test_pkg_gen(pkg_gen_spec_file, cli_runner, tmp_path, tasks_template_args):
outputs_dir = tmp_path / "output-dir"
outputs_dir.mkdir()

Expand All @@ -24,6 +24,7 @@ def test_pkg_gen(pkg_gen_spec_file, cli_runner, tmp_path):
[
str(pkg_gen_spec_file),
str(outputs_dir),
],
]
+ tasks_template_args,
)
assert result.exit_code == 0, show_cli_trace(result)
5 changes: 3 additions & 2 deletions nipype2pydra/tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def package_spec(request):


@pytest.mark.xfail(reason="Fails due to missing dependencies on PyPI")
def test_package_complete(package_spec, cli_runner, tmp_path):
def test_package_complete(package_spec, cli_runner, tmp_path, tasks_template_args):
pkg_name = package_spec.stem
repo_output = tmp_path / "repo"
repo_output.mkdir()
Expand All @@ -43,7 +43,8 @@ def test_package_complete(package_spec, cli_runner, tmp_path):
[
str(package_spec),
str(repo_output),
],
]
+ tasks_template_args,
)
assert result.exit_code == 0, show_cli_trace(result)
pkg_root = repo_output / f"pydra-{pkg_name}"
Expand Down
0