Skip to content

Commit

Permalink
improve github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalebi committed Jan 30, 2024
1 parent 99b5809 commit 26daab2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# Workflow name
name: PyTest and Black
name: PyTest, Black and Pylint

# Controls when the workflow will run
on:
# Triggers the workflow on pull request (on main only) events
# Triggers the workflow on pull request (on main and develop only) events
pull_request:
branches:
- main
- develop

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# This workflow contains a single job called "tests"
tests:
# The type of runner that the job will run on and timeout in minutes
name: Run Python Tests and Black formatter
runs-on: ubuntu-latest
timeout-minutes: 10

# Include a strategy matrix in order to allow the job to run multiple times with different versions of Python
strategy:
matrix:
python-version: [3.8, 3.9]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
Expand Down Expand Up @@ -47,4 +53,9 @@ jobs:
# Check code has been formatted
- name: Run Black code formatter
run: |
black . --check --verbose --diff --color
black . --check --verbose --diff --color
# Run Pylint
- name: Run Pylint
run: |
pylint $(git ls-files '*.py') --fail-under=9.5
3 changes: 1 addition & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ build:
only:
- develop
- main
- hotfix/improve_pylint

# Template to deploy application to web's k8s cluster
.deploy-web:
Expand All @@ -76,7 +75,7 @@ build:
variables:
BASE: k8s/web-prod/overlays/apps
rules:
- if: '$CI_DEPLOY_FREEZE == null && $CI_COMMIT_BRANCH == "hotfix/improve_pylint" && $CI_PROJECT_NAMESPACE== "ensembl-apps"'
- if: '$CI_DEPLOY_FREEZE == null && $CI_COMMIT_BRANCH == "develop" && $CI_PROJECT_NAMESPACE== "ensembl-apps"'

# deploy to staging at WP-HX
staging:wp-hx:
Expand Down

0 comments on commit 26daab2

Please sign in to comment.