Skip to content

Introduced Linting (#2) #33

Introduced Linting (#2)

Introduced Linting (#2) #33

Workflow file for this run

name: Build & Test
on:
push:
branches:
- '*'
jobs:
lint:
name: Python Linux (flake8)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run Lint
run: flake8 --verbose --color auto --count --statistics --format=json --output-file=flake8-report.json || echo "::set-output name=flake8_failed::true"
continue-on-error: true
- name: Upload Report
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: flake8-report
path: flake8-report.json
build_and_test:
name: Build and Test
runs-on: windows-latest
needs: lint
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Install Pytest
run: |
pip install pytest
- name: Build Package
run: |
python setup.py sdist
- name: Get Package File Name
run: |
$latestFile = Get-ChildItem -Path 'dist\' | Sort-Object LastWriteTime -Descending | Select-Object -First 1
echo "Latest file: $latestFile"
echo "PACKAGE_NAME=$latestFile" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Install Package
run: |
pip install ${{ env.PACKAGE_NAME }}
- name: Run Tests
run: |
pytest tests -vv -rEPW -o pytest_collection_order=alphabetical --cache-clear --color=yes