Skip to content

Commit

Permalink
Merge pull request #73 from nicrie:update-workflows
Browse files Browse the repository at this point in the history
ci: update Github Action workflows
  • Loading branch information
nicrie authored Aug 5, 2023
2 parents 81ccaa8 + 7919090 commit 7e679bc
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 84 deletions.
76 changes: 0 additions & 76 deletions .github/workflows/CI.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/black_formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code Formatting Check

on:
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened, edited]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab


jobs:
black_formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Check Code Formatting with Black
uses: psf/black@stable
with:
src: "./xeofs"
version: "~= 23.7.0"
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Basic workflow for building and testing the pip installation

name: Continuous Integration

on:
pull_request:
branches: [ main, develop ]
types: [opened, synchronize, reopened, edited]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab

jobs:

Code_Quality_Check:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', 3.11]
steps:
- name: Checkout Repository
uses: actions/checkout@v3

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

- name: Setup Poetry
uses: abatilo/actions-poetry@v2.1.0
with:
poetry-version: 1.5.1

- name: Configure Poetry Settings
shell: bash
run: python -m poetry config virtualenvs.in-project true

- name: Verify Poetry Version
run: poetry --version

- name: Install Project Dependencies
run: python -m poetry install

- name: Lint Codebase with flake8
run: |
python -m poetry run flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
python -m poetry run flake8 . --exclude .venv --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
- name: Execute Tests with pytest and Coverage
run: |
python -m poetry run coverage run -m pytest
python -m poetry run coverage report -m
python -m poetry run coverage xml
- name: Upload Coverage Report to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml

Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
# Aim: ensure that PR title matches the concentional commits spec
# More info: https://github.com/marketplace/actions/semantic-pull-request

name: "Lint PR"
name: "Pull Request Linting"

on:
pull_request_target:
types:
- opened
- edited
- synchronize
types: [opened, edited, synchronize]

jobs:
main:
name: Validate PR title
PR_Validation:
name: Validate Pull Request Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
- name: Run Semantic Pull Request Linting
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/release_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release Package After Merge

on:
push:
branches:
- main
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab


jobs:
Release_Package:
runs-on: ubuntu-latest
concurrency: release

steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Execute Semantic Release
uses: python-semantic-release/python-semantic-release@v7.34.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit 7e679bc

Please sign in to comment.