Skip to content

Commit

Permalink
Merge branch 'kliment:master' into upd_translation
Browse files Browse the repository at this point in the history
  • Loading branch information
DivingDuck authored Jun 28, 2024
2 parents 4fa66b3 + d66a170 commit 5e02634
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 13 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/buildpackage-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
release:
types:
- created
- published

jobs:
build:
Expand Down Expand Up @@ -56,20 +56,25 @@ jobs:
- name: Configuration for releases
if: ${{ github.event_name == 'release' }}
run: |
echo "EXE_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
echo "EXE_NAME=${{ github.ref_name }}_macos_${{ matrix.architecture }}" >> $GITHUB_ENV
- name: Configuration for pushes
if: ${{ github.event_name == 'push' }}
run: |
echo "EXE_NAME=printrun-nightly" >> $GITHUB_ENV
echo "EXE_NAME=printrun-nightly_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Configuration for pull requests
if: ${{ github.event_name != 'release' && github.event_name != 'push' }}
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "EXE_NAME=printrun-test" >> $GITHUB_ENV
echo "EXE_NAME=printrun-test_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}" >> $GITHUB_ENV
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v4
with:
name: ${{ env.EXE_NAME }}_${{ matrix.os }}_${{ matrix.architecture }}_py${{ matrix.python-version }}
name: ${{ env.EXE_NAME }}
path: dist/Pronterface-app.zip

upload_release_assets:
needs: [build]
if: github.event_name == 'release' && github.event.action == 'published'
uses: kliment/Printrun/.github/workflows/upload-assets.yml@master
9 changes: 7 additions & 2 deletions .github/workflows/buildpackage-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
release:
types:
- created
- published

jobs:
build:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
"EXE_NAME=printrun-nightly" >> $env:GITHUB_ENV
- name: Configuration for pull requests
if: ${{ github.event_name != 'release' && github.event_name != 'push' }}
if: ${{ github.event_name == 'pull_request' }}
run: |
"EXE_NAME=printrun-test" >> $env:GITHUB_ENV
Expand All @@ -88,3 +88,8 @@ jobs:
dist/Pronterface.exe
dist/Pronsole.exe
dist/locale
upload_release_assets:
needs: [build]
if: github.event_name == 'release' && github.event.action == 'published'
uses: kliment/Printrun/.github/workflows/upload-assets.yml@master
31 changes: 26 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,21 @@ on:
pull_request:

jobs:
test:
functional_test:
name: Functional testing with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
include:
# Set unit testing to false on all combinations
- unit-test: false
- python-version: "3.8"
wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp38-cp38-linux_x86_64.whl"
- python-version: "3.9"
wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp39-cp39-linux_x86_64.whl"
- python-version: "3.10"
wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp310-cp310-linux_x86_64.whl"
- python-version: "3.11"
unit-test: true
wxpython-wheel: "ubuntu-22.04/wxPython-4.2.1-cp311-cp311-linux_x86_64.whl"

steps:
Expand All @@ -46,10 +44,33 @@ jobs:
python -m pip install -r requirements.txt
- name: Perform functional tests
# Simple test that but might be enough to detect regressions
# particularly those due to wxPython versions
run: |
./pronterface.py -h
unit_test:
name: Unit testing with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13-dev"]
# Unit testing uses functions not available on Python < 3.11

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Printrun dependencies for unit testing
run: |
python -m pip install --upgrade pip
python -m pip install pyserial
- name: Perform unit tests
if: ${{ matrix.unit-test }}
run: |
python -m unittest discover tests
40 changes: 40 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Upload Assets to Releases

on:
workflow_call:

jobs:
upload_release_assets:
runs-on: ubuntu-latest
permissions:
contents: write
checks: write
actions: read
issues: read
packages: write
pull-requests: read
repository-projects: read
statuses: read
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
pattern: printrun-*
path: upload
merge-multiple: false

- name: Zip artifacts for uploading
run: |
cd upload || { echo "Failed to cd into 'upload'"; exit 1; }
for i in *; do
cd "$i" || { echo "Failed to cd into '$i'"; exit 1; }
zip -r "../$i.zip" ./*
cd ..
done
- name: Upload assets
uses: alexellis/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["upload/*.zip"]'

0 comments on commit 5e02634

Please sign in to comment.