Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr/yarikoptic/601
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Apr 3, 2024
2 parents 272dc24 + d5fd9f7 commit 7c81b80
Show file tree
Hide file tree
Showing 45 changed files with 1,503 additions and 1,445 deletions.
4 changes: 0 additions & 4 deletions .codespellrc

This file was deleted.

99 changes: 50 additions & 49 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# this workflow bootstraps the testing of the build the docker images
#
# - this will run the python script used to generate the workflows
Expand All @@ -8,16 +9,16 @@
name: bootstrap

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches: [ "master" ]
paths:
- .github/workflows/bootstrap.yml
- .github/workflows/create_workflows.py
- neurodocker/**
push:
branches: [master]
paths:
- .github/workflows/bootstrap.yml
- .github/workflows/create_workflows.py
- neurodocker/**

# Uses the cron schedule for github actions
#
Expand All @@ -33,53 +34,53 @@ on:
# │ │ │ │ │
# * * * * *

schedule:
- cron: 0 0 1,15 * *
schedule:
- cron: 0 0 1,15 * *

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
software_name:
description: 'software to test'
required: true
default: 'all'
workflow_dispatch:
inputs:
software_name:
description: software to test
required: true
default: all

permissions:
contents: write
actions: write
contents: write
actions: write
jobs:
bootstrap:
runs-on: ubuntu-22.04
bootstrap:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_FLOW }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_FLOW }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: python -m pip install jinja2 pyyaml
- name: Install dependencies
run: python -m pip install jinja2 pyyaml

- name: Create workflows
run: |
software_name=${{ inputs.software_name }}
if [ -z "$software_name" ]; then
software_name="all"
fi
if [ "$software_name" = "all" ]; then
echo "testing all software"
else
echo "testing ${software_name}"
fi
git checkout -b test_docker_build
python .github/workflows/create_workflows.py --software_name ${software_name}
ls -l .github/workflows
git add .
git config --global user.email "[email protected]"
git config --global user.name "Repronim neurodocker bot"
git commit -am "added new workflows"
git push origin --force test_docker_build
- name: Create workflows
run: |
software_name=${{ inputs.software_name }}
if [ -z "$software_name" ]; then
software_name="all"
fi
if [ "$software_name" = "all" ]; then
echo "testing all software"
else
echo "testing ${software_name}"
fi
git checkout -b test_docker_build
python .github/workflows/create_workflows.py --software_name ${software_name}
ls -l .github/workflows
git add .
git config --global user.email "[email protected]"
git config --global user.name "Repronim neurodocker bot"
git commit -am "added new workflows"
git push origin --force test_docker_build
26 changes: 0 additions & 26 deletions .github/workflows/codespell.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/create_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
and on the branch where the workflows are pushed to (currently "test_docker_build").
"""

import argparse
from pathlib import Path

Expand Down
47 changes: 24 additions & 23 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
on:
push:
branches:
- master
push:
branches:
- master
permissions:
contents: write
contents: write
jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install neurodocker
run: python -m pip install --editable .[all]
- name: build docs
run: |
make -C docs cli
make -C docs list
sphinx-build docs docs-build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-build # The folder the action should deploy.
build_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install neurodocker
run: python -m pip install --editable .[all]
- name: build docs
run: |
make -C docs cli
make -C docs list
sphinx-build docs docs-build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-build # The folder the action should deploy.
39 changes: 20 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---
name: Publish to pypi on Github release

on:
release:
types: [published]
release:
types: [published]

jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install build & twine
run: python -m pip install build twine
- name: Install build & twine
run: python -m pip install build twine

- name: Publish to pypi
run: |
python -m build
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Publish to pypi
run: |
python -m build
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
73 changes: 37 additions & 36 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
---
name: CI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
branches: [ master ]
pull_request:
branches: [master]

jobs:
run-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.12', '3.11', '3.10', '3.9', '3.8']
fail-fast: false
steps:
- name: Install Apptainer
env:
VERSION: 1.1.5
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-suid_${VERSION}_amd64.deb
sudo apt-get install --yes ./apptainer*
- name: Set Apptainer/Singularity environment variables
run: |
# Give reproenv the full path to apptainer, so it still works with `sudo`.
echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV
echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install neurodocker
run: python -m pip install --editable .[dev]
- name: Run python tests
run: pytest --numprocesses auto
- name: Get code coverage
run: codecov
run-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.12', '3.11', '3.10', '3.9', '3.8']
fail-fast: false
steps:
- name: Install Apptainer
env:
VERSION: 1.1.5
run: |
sudo apt-get update
sudo apt-get install -y wget
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer_${VERSION}_amd64.deb
wget https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-suid_${VERSION}_amd64.deb
sudo apt-get install --yes ./apptainer*
- name: Set Apptainer/Singularity environment variables
run: |
# Give reproenv the full path to apptainer, so it still works with `sudo`.
echo REPROENV_APPTAINER_PROGRAM=apptainer >> $GITHUB_ENV
echo APPTAINER_CACHEDIR=/dev/shm/$(whoami)/singularity >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install neurodocker
run: python -m pip install --editable .[dev]
- name: Run python tests
run: pytest --numprocesses auto
- name: Get code coverage
run: codecov
Loading

0 comments on commit 7c81b80

Please sign in to comment.