Skip to content
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

Poetry support,fix workflows, update python #45

Merged
merged 15 commits into from
Dec 5, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
--fail \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.BUMPVERSION_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/deployments \
-H "Authorization: token ${{secrets.BUMPVERSION_TOKEN}}" \
https://api.github.com/repos/${{github.repository}}/deployments \
-d '{
"ref": "${{ github.event.inputs.tag_name }}",
"ref": "${{github.event.inputs.tag_name}}",
"environment": "production",
"auto_merge": false,
"description": "${{secrets.DEPLOYMENT_INFO}}"}'
4 changes: 1 addition & 3 deletions .github/workflows/deploy_stage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

name: Deploy branch to staging environment

on:
Expand All @@ -24,4 +22,4 @@ jobs:
"ref": "${{ github.event.inputs.branch_name }}",
"environment": "stage",
"auto_merge": false,
"description": "${{secrets.DEPLOYMENT_INFO}}"}'
"description": "${{secrets.DEPLOYMENT_INFO}}"}'
16 changes: 9 additions & 7 deletions .github/workflows/merge_master_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,33 @@ jobs:
name: Create staging image
steps:
- name: Check out git repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Extract branch name and remove illegal chars
id: get_branch_name
shell: bash
run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")"
run: echo "branch=$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" >> $GITHUB_OUTPUT


- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
push: true
tags: "clinicalgenomics/arnold-stage:${{steps.get_branch_name.outputs.branch}}, clinicalgenomics/arnold-stage:latest"
tags: "clinicalgenomics/arnold-stage:${{steps.get_branch_name.outputs.branch}},clinicalgenomics/arnold-stage:latest"


tests-coverage:
runs-on: ubuntu-latest
Expand All @@ -56,7 +58,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
python-version: "3.11"

- name: Check out cg_lims
uses: actions/checkout@v2
Expand Down
22 changes: 6 additions & 16 deletions .github/workflows/pull_request_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,31 @@ name: Pull Request Actions
on: [push]

jobs:
black-lint:
runs-on: ubuntu-latest
name: Black
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: psf/black@stable
with:
black_args: ". --check --line-length 100"

docker-image-push:
runs-on: ubuntu-latest
name: Create staging docker image
steps:
- name: Check out git repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Extract branch name and remove illegal chars
id: get_branch_name
shell: bash
run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")"
run: echo "branch=$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
Expand All @@ -53,7 +43,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.11

- name: Check out arnold
uses: actions/checkout@v2
Expand Down
40 changes: 4 additions & 36 deletions .github/workflows/release_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:

- name: Extract branch name and remove illegal chars
id: get_branch_name
shell: bash
run: echo "##[set-output name=branch;]$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")"
run: echo "branch=$(echo "$(tr "/" "-" <<<${GITHUB_REF#refs/heads/})")" >> $GITHUB_OUTPUT

- name: Login to Docker Hub
uses: docker/login-action@v1
Expand All @@ -27,44 +26,13 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: ./
file: ./Dockerfile
push: true
tags: "clinicalgenomics/arnold:${{github.event.release.tag_name}}, clinicalgenomics/arnold:latest"

build-n-publish:
name: Build and publish Python distribution to PyPI
runs-on: ubuntu-latest
steps:
- name: Check out git repository
uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install build tools
run: >-
python -m
pip install
wheel
twine
--user
- name: Build a binary wheel and a source tarball
run: >-
python
setup.py
sdist
bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
tags: "clinicalgenomics/arnold:${{github.event.release.tag_name}}, clinicalgenomics/arnold:latest"
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.289
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: [ --line-length=100 ]
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10-slim
FROM python:3.11-slim-bullseye

LABEL base_image="python:3.10-slim"
LABEL base_image="python:3.11-slim-bullseye"
LABEL about.home="https://github.com/Clinical-Genomics/arnold"
LABEL about.tags="CG Core database and API"

Expand Down
Loading
Loading