Skip to content

fix: CI/CD

fix: CI/CD #11

Workflow file for this run

name: CI/CD
on:
push
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python with Poetry
uses: mishaga/action-poetry@1
with:
python-version: ${{ matrix.python-version }}
afterwards: "poetry install --no-root"
- name: Analysing the code with flake8
run: flake8 --count basic_data_structure/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python with Poetry
uses: mishaga/action-poetry@1
with:
python-version: ${{ matrix.python-version }}
afterwards: "poetry install --no-root"
- name: Testing code with pytest
run: pytest -v
build-doc:
if: github.event.pull_request.merged == true
needs:
- lint
- test
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python with Poetry
uses: mishaga/action-poetry@1
with:
python-version: '3.12'
afterwards: "poetry install --no-root"
- name: Generate documentation
run: |
mkdir docs
pdoc -o docs/ -d google --no-search --no-show-source basic_data_structure
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/
deploy-doc:
if: github.event.pull_request.merged == true
needs: build-doc
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Documentation deployment
id: deployment
uses: actions/deploy-pages@v4