do: add prod reqs to ci #7
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| ENV_FILE: .env | |
| jobs: | |
| env-vars: | |
| name: Get Environment Variables | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python-version: ${{ steps.load-env.outputs.python-version }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Load Environment Variables | |
| id: load-env | |
| run: | | |
| set -a | |
| [ -f ${{ env.ENV_FILE }} ] && source ${{ env.ENV_FILE }} | |
| echo "::set-output name=python-version::$PYTHON_VERSION" | |
| env-setup: | |
| name: Setup Python and Install Dependencies | |
| runs-on: ubuntu-latest | |
| needs: env-vars | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| id: setup-python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ needs.env-vars.outputs.python-version }} | |
| - name: Create Python Dev-tools Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-dev-tools-dev-tools-${{ hashFiles('requirements.dev.txt') }} | |
| - name: Install Development Dependencies | |
| run: pip install -r requirements.dev.txt | |
| - name: Create Python prod-libs Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-prod-libs-${{ hashFiles('requirements.txt') }} | |
| - name: Install Prod Dependencies | |
| run: pip install -r requirements.txt | |
| lint: | |
| name: Flake8 linting | |
| runs-on: ubuntu-latest | |
| needs: env-setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Restore Python Dev-tools Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-dev-tools-${{ hashFiles('requirements.dev.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-dev-tools- | |
| - name: Install Flake8 | |
| run: pip install flake8 flake8-pyproject | |
| - name: Run Flake8 | |
| run: flake8 . | |
| security: | |
| name: Security Check | |
| runs-on: ubuntu-latest | |
| needs: env-setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Restore Python Dev-tools Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-dev-tools-${{ hashFiles('requirements.dev.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-dev-tools- | |
| - name: Install Bandit | |
| run: pip install bandit | |
| - name: Run Bandit Security Check | |
| run: bandit -r . | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| needs: env-setup | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Restore Python Dev-tools Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-dev-tools-${{ hashFiles('requirements.dev.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-dev-tools- | |
| - name: Restore Python Prod Dependencies Cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-prod-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip-prod- | |
| - name: Install Pylint, Black & Pydocstyle | |
| run: pip install pylint black pydocstyle | |
| - name: Install Prod libs | |
| run: pip install -r requirements.txt | |
| - name: Pylint linting | |
| run: pylint . | |
| - name: Check Black Formatting | |
| run: black --check . | |
| - name: Check Pydocstyle | |
| run: pydocstyle . | |
| continue-on-error: true # Non-blocking |