Skip to content

Merge pull request #1809 from subzeroid/dependabot/pip/mkdocs-materia… #1606

Merge pull request #1809 from subzeroid/dependabot/pip/mkdocs-materia…

Merge pull request #1809 from subzeroid/dependabot/pip/mkdocs-materia… #1606

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Package
on:
push:
branches: [ "master" ]
pull_request: {}
env:
PYTHON_VERSION: "3.9.14"
jobs:
bandit:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
test-requirements: "true"
- name: Run bandit
run: bandit --ini .bandit -r instagrapi
flake8:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
test-requirements: "true"
- name: Run flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --statistics
isort:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
requirements: "true"
test-requirements: "true"
- name: Run isort
run: isort --check-only instagrapi
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10" ]
env:
TEST_ACCOUNTS_URL: ${{ secrets.TEST_ACCOUNTS_URL }}
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
requirements: "true"
test-requirements: "true"
- name: Run media test
run: pytest -sv tests.py::ClientMediaTestCase
- name: Run user test
run: pytest -sv tests.py::ClientUserTestCase
# - name: Run comment test
# run: pytest -sv tests.py::ClientCommentTestCase
# - name: Run location test
# run: pytest -sv tests.py::ClientLocationTestCase
# - name: Run hashtag test
# run: pytest -sv tests.py::ClientHashtagTestCase
# - name: Run share test
# run: pytest -sv tests.py::ClientShareTestCase
- name: Run highlight test
run: pytest -sv tests.py::ClientHighlightTestCase
build-docs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
requirements: "true"
test-requirements: "true"
- name: Build Docs
run: mkdocs build --strict
# upload artifact for dev build
- name: Upload coverage results artifact
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: docs-site
path: site/
update-dev-docs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
uses: ./.github/actions/install-dependencies
with:
requirements: "true"
test-requirements: "true"
- name: Push documentaiton changes
uses: ./.github/actions/publish-docs-with-mike
with:
version_name: dev