-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from nicrie:update-workflows
ci: update Github Action workflows
- Loading branch information
Showing
5 changed files
with
110 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |