Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gbazad93 authored Dec 9, 2024
2 parents a63f719 + 161304d commit e379bf3
Show file tree
Hide file tree
Showing 141 changed files with 8,756 additions and 4,626 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,21 @@ on:
jobs:

pre-commit-checks:
strategy:
matrix:
os: [ "macos-latest", "windows-latest", "ubuntu-18.04", "ubuntu-20.04", "macos-10.15"]
python-version: [3.6, 3.7, 3.8]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Cache pip dependencies
id: cache-pip-dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
# Ubuntu-specific, see
# https://github.com/actions/cache/blob/main/examples.md#python---pip
Expand All @@ -40,9 +36,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [[ -f requirements_dev.txt ]]; then pip install -r requirements_dev.txt; fi
pip install -e .
pre-commit install
pip install 'pre-commit>=2.10.1'
shell: bash

- name: Run pre-commit large file check
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@ on:
# publish from the Releases page:
release:
types: [published]
# publish from the Actions page:
workflow_dispatch:
inputs:
version:
description: 'Version (e.g. 2.0.3)'
required: true

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
uses: actions/setup-python@v3

- name: Install dependencies
run: |
Expand All @@ -41,10 +33,8 @@ jobs:
with:
files: 'dist/*'
fail_on_unmatched_files: true
tag_name: ${{ github.event.inputs.version }} # in the workflow_dispatch case, make a new tag from the given input; in the published release case, this will be empty and will fall back to updating that release.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'dev') }}

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
58 changes: 43 additions & 15 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,33 @@ on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.rst'
- '**.bib'
- '.github/**'
- '!.github/workflows/run_tests.yml'
- 'dev/**'
- 'docs/**'
- 'images/**'
- '.gitignore'
- '.pre-commit-config.yaml'
- '.readthedocs.yml'
# Trigger the workflow on pull requests, but reveal no secrets, do not use pull_request_target, see:
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target
pull_request:
paths-ignore:
- '**.md'
- '**.rst'
- '**.bib'
- '.github/**'
- '!.github/workflows/run_tests.yml'
- 'dev/**'
- 'docs/**'
- 'images/**'
- '.gitignore'
- '.pre-commit-config.yaml'
- '.readthedocs.yml'

env:
# Even when given -y, apt will still sometimes hang at a prompt if a package
Expand All @@ -19,14 +43,16 @@ env:
# (TravisCI quietly defined this on all their platforms, but we have to give it manually on GithubCI.)
DEBIAN_FRONTEND: 'noninteractive'
HDF5_USE_FILE_LOCKING: 'FALSE'
# Skip to the headless matplotlib renderer, which is less
# bug-prone in the constrained environment of CI
# Tip from a matplotlib dev: https://github.com/spinalcordtoolbox/spinalcordtoolbox/issues/3388#issuecomment-846091012
# Ref: https://matplotlib.org/stable/users/explain/backends.html
MPLBACKEND: 'Agg'

jobs:
ultra_matrix_test:
name: Matrix Test of Python ${{ matrix.python-version }} on ${{ matrix.os }}

# Matrix driven OS
runs-on: ${{ matrix.os }}

# Default shell for ALL subsequent steps.
defaults:
run:
Expand All @@ -39,32 +65,34 @@ jobs:
fail-fast: false

matrix:
os: [ "macos-latest", "windows-latest", "ubuntu-18.04", "ubuntu-20.04", "macos-10.15" ]
python-version: [ 3.6, 3.7, 3.8 ]
os: [ "macos-latest", "windows-latest", "ubuntu-20.04" ]
python-version: [ '3.8', '3.9', '3.10' ]
test-name:
- integration-test

# Matrix driven OS
runs-on: ${{ matrix.os }}

# Main steps for the test to be reproduced across OS x Python
steps:
# Step 0: Checkout code.
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Step 1: Setup python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

# Step 2: Install requirement dependencies.
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: "requirements_dev.txt"
# Step 2: Install dependencies
- name: Install ivadomed
run: |
pip install -e .[dev]
# Step 3: install additional pytest/dev related dependencies
- name: Install IvadoMed Main Modules
# Step 3: List installed packages
- name: List installed packages
run: |
pip install -e .
pip list
# Step 4: Lint.
- name: Lint with flake8
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/run_tests_dummy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is a dummy version of run_tests.yml, which allows for conditional checks to still be "Required Statuses" for pull requests to be allowed to be merged

name: Run tests on all platforms

# see https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
# and https://github.com/orgs/community/discussions/13690
on:
pull_request:
paths:
# this list needs to be kept in sync manually with the opposite list in run_tests.yml
- '**.md'
- '**.rst'
- '**.bib'
- '.github/**'
- '!.github/workflows/run_tests.yml'
- 'dev/**'
- 'docs/**'
- 'images/**'
- '.gitignore'
- '.pre-commit-config.yaml'
- '.readthedocs.yml'

jobs:
ultra_matrix_test:
name: Matrix Test of Python ${{ matrix.python-version }} on ${{ matrix.os }}

# this section also needs to be kept in sync with run_tests.yml
strategy:
matrix:
# This list must be kept **in sync** with the Required Statuses in https://github.com/ivadomed/ivadomed/settings/branch_protection_rules/5051948
os: [ "macos-latest", "windows-latest", "ubuntu-20.04" ]
python-version: [ 3.8 ]
test-name:
- integration-test

runs-on: ubuntu-latest

steps:
- run: 'echo "No code changes, so no build required" '
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ log.txt
# Pycharm stuff
.idea

# VSCode stuff
.vscode

# Pytest Cache, anywhere:
.pytest_cache/

# IvadoMed pytest downloaded data file, anywhere:
data_testing/
data_functional_testing/
data_multi_testing/

# OS Specific hidden file
.DS_Store

# venv
venv/
venv/
11 changes: 7 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

python:
version: 3.7
install:
# Ensure the Find External Link PyTorch version is installed
- requirements: requirements_dev.txt
# Install IvadoMed package via setup.py content
- method: pip
path: .
extra_requirements:
- docs
- dev
Loading

0 comments on commit e379bf3

Please sign in to comment.