Skip to content

Remove setup.cfg, new workflow, update packages and more #16

Remove setup.cfg, new workflow, update packages and more

Remove setup.cfg, new workflow, update packages and more #16

Workflow file for this run

name: Workflow Name
# This workflow runs on push
on:
push:
branches: [main]
# Set up environment variables
env:
# Folder where the project code is located
SRC_PROJECT_FOLDER: "src"
# Folder where test files are located
SRC_PROJECT_TESTS: "tests"
# Python version to use
SRC_PYTHON_VERSION: "3.11"
# Define jobs in this workflow
jobs:
setup-lint-test:
name: Setup, Lint, Test, Security the Code
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
# Step 1: Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up the Python environment and install dependencies for testing and
# linting
- name: Setup Python environment and dependencies
uses: ./.github/actions/setup-python-env
with:
src-python-version: ${{ matrix.python-version }}
dependencies: "test,lint"
# Step 3: Run code linting to check code style, syntax, and quality using Black,
# MyPy and Flake8
- name: Check code format, syntax and quality
uses: ./.github/actions/lint-code
with:
src-project-folder: ${{ env.SRC_PROJECT_FOLDER }}
# Step 4: Run tests using PyTest in the project
- name: Test code
uses: ./.github/actions/test-code
with:
src-project-folder: ${{ env.SRC_PROJECT_FOLDER }}
src-tests-folder: ${{ env.SRC_PROJECT_TESTS }}
# Step 5: Check security
- name: Check security
uses: ./.github/actions/security
with:
src-project-folder: ${{ env.SRC_PROJECT_FOLDER }}
src-exclude: ${{ env.SRC_PROJECT_TESTS }}
build-mkdocs:
name: Build MkDocs Wiki
runs-on: ubuntu-latest
needs: setup-lint-test
permissions:
contents: write
steps:
# Step 1: Checkout the repository code
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up the Python environment and install dependencies for documentation
- name: Setup Python environment and dependencies
uses: ./.github/actions/setup-python-env
with:
src-python-version: ${{ env.SRC_PYTHON_VERSION }}
dependencies: "docs"
# Step 3: Build the MkDocs site
- name: Build MkDocs
uses: ./.github/actions/build-mkdocs
deploy-mkdocs:
name: Deploy MkDocs Wiki to GitHub Pages
runs-on: ubuntu-latest
needs: build-mkdocs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Step 1: Checkout the repository code, specifically the 'gh-pages' branch
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: gh-pages
# Step 2: Set up the GitHub Pages action
- name: Setup Pages
uses: actions/configure-pages@v5
# Step 3: Upload the built documentation as an artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "."
# Step 4: Deploy the MkDocs site to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4