Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions .github/workflows/hdc-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: HDC ci/cd pipeline

permissions:
contents: write
issues: write
pull-requests: write

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.14

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Set up cache
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.0

- name: Run tests
run: poetry run pytest -vvv --exitfirst --cov=app --cov-report=term --cov-report=xml --cov-fail-under=23

- name: Coverage report comment
uses: mishakav/pytest-coverage-comment@v1.1.42
with:
pytest-xml-coverage-path: ./coverage.xml
coverage-path-prefix: app/

extract-branch-name:
runs-on: ubuntu-latest
needs: [ tests ]
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Extract Branch Name
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT

push-binary:
needs: [ extract-branch-name ]
if: ${{ needs.extract-branch-name.outputs.branch == 'main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ needs.extract-branch-name.outputs.branch }}

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10.14

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Set up cache
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Build binary
run: poetry run pyinstaller -F --distpath ./app/bundled_app/linux --specpath ./app/build/linux --workpath ./app/build/linux --paths=./.venv/lib/python3.10/site-packages ./app/pilotcli.py -n ${{ github.sha }}

- name: Set version in env
run: poetry run echo "TAG_VERSION=`poetry version --short`" >> $GITHUB_ENV

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.TAG_VERSION }}-${{ needs.extract-branch-name.outputs.branch }}
release_name: Release ${{ needs.extract-branch-name.outputs.branch }} ${{ env.TAG_VERSION }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false

- name: Upload Release Binary
id: upload-release-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./app/bundled_app/linux/${{ github.sha }}
asset_name: pilotcli
asset_content_type: application/octet-stream
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ repos:
'--max-line-length=120',
]

# - repo: https://github.com/PyCQA/docformatter
# rev: v1.7.5
# hooks:
# - id: docformatter
# args: [
# '--wrap-summaries=120',
# '--wrap-descriptions=120',
# '--in-place',
# ]
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.7
hooks:
- id: docformatter
args: [
'--wrap-summaries=120',
'--wrap-descriptions=120',
'--in-place',
]

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@ The development of the HealthDataCloud open source software was supported by the
This project has received funding from the European Union’s Horizon Europe research and innovation programme under grant agreement No 101058516. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or other granting authorities. Neither the European Union nor other granting authorities can be held responsible for them.

![EU HDC Acknowledgement](https://hdc.humanbrainproject.eu/img/HDC-EU-acknowledgement.png)

5 changes: 3 additions & 2 deletions app/resources/custom_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
class HelpPage:
page = {
'update': {
'version': '2.2.6',
'1': 'CLI supports listing of all datasets a project administrator has access to.',
'version': '2.2.7',
'1': 'Removed ability to upload to core zone and to download from greenroom zone'
' for more secure file handling workflow.',
},
'dataset': {
'DATASET_DOWNLOAD': 'Download a dataset or a particular version of a dataset.',
Expand Down
Loading
Loading