Skip to content

Commit

Permalink
Merge pull request #43 from nahid18/feat/gh-action
Browse files Browse the repository at this point in the history
feat: init github action
  • Loading branch information
cmatKhan authored Aug 31, 2023
2 parents 9d8e2c8 + e6b7078 commit 0b6ab79
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/isocomp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Python package with Poetry and MkDocs Deploy

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Cache Poetry dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies using Poetry
run: |
poetry install
- name: Lint with flake8 using Poetry
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 80 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
- name: Test with pytest using Poetry
run: |
poetry run python -m pytest
deploy:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install MkDocs
run: pip install mkdocs

- name: Build MkDocs documentation
run: mkdocs build

- name: Deploy to GitHub Pages
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
mkdocs gh-deploy --force
- name: Clean up
run: |
rm -rf site

0 comments on commit 0b6ab79

Please sign in to comment.