Skip to content

Add debugging steps to investigate Python version issues in GitHub Ac… #17

Add debugging steps to investigate Python version issues in GitHub Ac…

Add debugging steps to investigate Python version issues in GitHub Ac… #17

Workflow file for this run

name: Linpad application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11] # Only valid versions
steps:
- uses: actions/checkout@v4
- name: Check Git Version
run: git --version
- name: Get version from Git tags
id: version
run: |
VERSION=$(git describe --tags --abbrev=0 || echo "0.0.1")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Display Python Version
run: python --version
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install core dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install development tools
run: |
pip install flake8==7.1.1 mypy==1.12.1 bandit==1.7.10 pytest==8.3.3
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Type checking with mypy
run: |
mypy .
- name: Security analysis with bandit
run: |
bandit -r . --skip B101 # Skip B101 assert rule
- name: Test with pytest
run: |
pytest test/
- name: Package Application
run: |
mkdir -p output
cp -r ./linpad.py ./output/
cp ./lin_logo.webp ./output/
cp -r ./DEBIAN ./output/
cp README.md ./output/
cp LICENSE ./output/
- name: Create .deb Package
run: |
cd output
dpkg-deb --build . linpad-${{ env.VERSION }}.deb
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Linpad ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload .deb to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: output/linpad-${{ env.VERSION }}.deb
asset_name: linpad-${{ env.VERSION }}.deb
asset_content_type: application/x-debian-package