PyQt6 #18
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: CD | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- '**.py' | |
- '.github/workflows/**' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- '**.py' | |
- '.github/workflows/**' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
QT_QPA_PLATFORM: offscreen | |
jobs: | |
# tests: | |
# runs-on: ubuntu-latest | |
# env: | |
# DISPLAY: ':99.0' | |
# steps: | |
# - uses: actions/[email protected] | |
# - name: Set up Python 3.12 | |
# uses: actions/[email protected] | |
# with: | |
# python-version: "3.12" | |
# - name: Install Python dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# pip install -r requirements.txt | |
# pip install flake8 pytest pytest-qt | |
# - name: Lint tests with flake8 | |
# run: flake8 ./tests --count --show-source --statistics | |
# - name: Run tests | |
# run: pytest tests/ | |
linux-cd: | |
name: Linux CD | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Python 3.12 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-cd.txt | |
- name: Lint with flake8 | |
run: python -m flake8 ./src ./tests --count --show-source --statistics | |
- name: Run tests | |
run: python -m pytest tests/ | |
- name: Run cx_freeze | |
run: python setup.py bdist_appimage | |
- name: Upload cx_freeze appimage | |
uses: actions/[email protected] | |
with: | |
name: Drill-linux.appimage | |
path: build/*.appimage | |
if-no-files-found: error | |
retention-days: 7 | |
compression-level: 9 | |
# macos: | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/[email protected] | |
# - name: Set up Python 3.12 | |
# uses: actions/[email protected] | |
# with: | |
# python-version: "3.12" | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# pip install -r requirements.txt | |
# pip install cx_Freeze dmgbuild | |
# - name: Run cx_freeze dmg | |
# run: python setup.py bdist_dmg | |
# - name: Upload cx_freeze app | |
# uses: actions/[email protected] | |
# with: | |
# name: Drill-macos.app | |
# path: build/dist/*.app | |
# if-no-files-found: error | |
# - name: Upload cx_freeze dmg | |
# uses: actions/[email protected] | |
# with: | |
# name: Drill-macos.dmg | |
# path: build/*.dmg | |
# if-no-files-found: error | |
windows: | |
name: Windows CD | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: "3.12" # msi not available for 3.13 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-cd.txt | |
- name: Lint with flake8 | |
run: python -m flake8 ./src ./tests --count --show-source --statistics | |
- name: Run tests | |
run: python -m pytest tests/ | |
- name: Run cx_freeze | |
run: python setup.py build_exe | |
- name: Upload exe | |
uses: actions/[email protected] | |
with: | |
name: Drill-windows | |
path: build/exe.win-amd64-3.12 | |
if-no-files-found: error | |
retention-days: 7 | |
compression-level: 9 | |
- name: Zip exe | |
run: | | |
$zipFile = "build/Drill-v${{ github.run_number }}-windows.zip" | |
Compress-Archive -Path "build/exe.win-amd64-3.12/*" -DestinationPath $zipFile | |
Write-Host "Zipped files to $zipFile" | |
- name: Create GitHub Release | |
if: github.event_name != 'pull_request' | |
uses: softprops/[email protected] | |
with: | |
tag_name: release-${{ github.run_number }} | |
name: Release ${{ github.run_number }} | |
generate_release_notes: true | |
files: build/Drill-v${{ github.run_number }}-windows.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Upload msi | |
# uses: actions/[email protected] | |
# with: | |
# name: Drill-windows.msi | |
# path: build/*.msi | |
# if-no-files-found: error |