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

Clean actions #82

Merged
merged 7 commits into from
Mar 7, 2024
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
37 changes: 37 additions & 0 deletions .github/workflows/build_dockerfile_on_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---

name: Build and publish docker image on push

on: [push]

jobs:
docker-image-push:
runs-on: ubuntu-latest
name: Create staging docker image
steps:
- name: Check out git repository
uses: actions/[email protected]

- 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/})")"

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
tags: "clinicalgenomics/genotype-api-stage:${{steps.get_branch_name.outputs.branch}}, clinicalgenomics/genotype-api-stage:latest"
18 changes: 18 additions & 0 deletions .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Bump2version-CI"
on:
push:
branches:
- "master"
- "main"
jobs:
bump-version:
runs-on: ubuntu-latest
name: Bump version and push tags to master
steps:
- name: Bump version
uses: Clinical-Genomics/bump2version-ci@v3
env:
BUMPVERSION_TOKEN: ${{ secrets.BUMPVERSION_TOKEN }}
BUMPVERSION_AUTHOR: ${{ secrets.BUMPVERSION_AUTHOR }}
BUMPVERSION_EMAIL: ${{ secrets.BUMPVERSION_EMAIL }}
GITHUB_REPOSITORY: ${{ github.repository }}
79 changes: 0 additions & 79 deletions .github/workflows/merge_master_ci.yml
Original file line number Diff line number Diff line change
@@ -1,79 +0,0 @@
name: 'Merge-master-CI'
on:
push:
branches:
- 'master'
- 'main'

jobs:
bump-version:
runs-on: ubuntu-latest
name: Bump version and push tags to master
steps:
- name: Bump version
uses: Clinical-Genomics/bump2version-ci@v3
env:
BUMPVERSION_TOKEN: ${{ secrets.BUMPVERSION_TOKEN }}
BUMPVERSION_AUTHOR: ${{ secrets.BUMPVERSION_AUTHOR }}
BUMPVERSION_EMAIL: ${{ secrets.BUMPVERSION_EMAIL }}
GITHUB_REPOSITORY: ${{ github.repository }}

docker-image-push:
runs-on: ubuntu-latest
name: Create staging image
steps:
- name: Check out git repository
uses: actions/[email protected]

- 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/})")"

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
tags: "clinicalgenomics/genotype-api-stage:${{steps.get_branch_name.outputs.branch}}, clinicalgenomics/genotype-api-stage:latest"

tests-coverage:
runs-on: ubuntu-latest
name: Test and coveralls
steps:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"

- name: Check out genotype-api
uses: actions/[email protected]
with:
repository: "Clinical-Genomics/genotype-api"

- name: Install genotype-api dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt .
- name: Install coveralls dependencies
run: |
pip install pytest-cov coveralls
- name: Test with pytest & Coveralls
run: |
pytest --cov=genotype-api/
coveralls
env:
GITHUB: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
78 changes: 0 additions & 78 deletions .github/workflows/pull_request_ci.yml
Original file line number Diff line number Diff line change
@@ -1,78 +0,0 @@
---

name: Pull Request Actions

on: [push]

jobs:
black-lint:
runs-on: ubuntu-latest
name: Black
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- 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/[email protected]

- 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/})")"

- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: ./
file: ./Dockerfile
push: true
tags: "clinicalgenomics/genotype-api-stage:${{steps.get_branch_name.outputs.branch}}, clinicalgenomics/genotype-api-stage:latest"

tests-coverage:
runs-on: ubuntu-latest
name: Test and coveralls
steps:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"

- name: Check out genotype-api
uses: actions/[email protected]
with:
repository: "Clinical-Genomics/genotype-api"

- name: Install genotype-api dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt .

- name: Install coveralls dependencies
run: |
pip install pytest-cov coveralls

- name: Test with pytest & Coveralls
run: |
pytest --cov=genotype_api/
coveralls
env:
GITHUB: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Loading