Skip to content

filemanager.py

filemanager.py #3

name: Python Package - SuperNano
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }} # Sesuaikan dengan versi Python yang digunakan oleh SuperNano
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# Lint seluruh direktori kecuali di bawah direktori migrations
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
run: |
# Jalankan pengujian
pytest
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Upload Python Package to PyPI (Test)
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/