Skip to content

fix test

fix test #124

Workflow file for this run

name: create apps
on:
push:
tags:
- '*'
defaults:
run:
shell: bash
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
- name: Generate changelog
id: changelog
uses: metcalfc/[email protected]
with:
mytoken: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: true
build:
name: Create Binaries
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, macos-12, macos-13, macos-14, windows-2022 ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Install project
run: poetry install --no-interaction
- name: pytest
run: |
PYTHONPATH=./src/main/python poetry run pytest --cov=./src/main/python
- name: Install packaging dependencies
run: |
if [[ "$RUNNER_OS" == "Linux" ]]
then
sudo apt install -y libblas-dev liblapack-dev libsndfile1 graphviz
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 libxcb-util1 libxcb-xkb1 libxcb-shape0
elif [[ "$RUNNER_OS" == "Windows" ]]
then
choco install openssl.light graphviz
elif [[ "$RUNNER_OS" == "macOS" ]]
then
brew install graphviz
brew ls -v graphviz
fi
poetry run pip install pyinstaller
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- name: Set version
run: |
echo ${{ steps.get_version.outputs.version-without-v }} > src/main/python/VERSION
- name: Create distribution
id: create_dist
run: |
export QT_DEBUG_PLUGINS=1
export DISPLAY=:0
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
poetry run pyinstaller --clean --log-level=INFO beqdesigner.spec
if [[ "$RUNNER_OS" == "macOS" ]]
then
pushd dist
rm beqdesigner
zip -r beqdesigner.app.zip_macos_$(sw_vers -productVersion) beqdesigner.app
rm -Rf beqdesigner.app
popd
MATCHES=( dist/beqdesigner.app.zip_* )
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT
echo "binary_content_type=application/zip" >> $GITHUB_OUTPUT
elif [[ "$RUNNER_OS" == "Windows" ]]
then
MATCHES=( dist/beqdesigner_* )
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT
echo "binary_content_type=application/vnd.microsoft.portable-executable" >> $GITHUB_OUTPUT
else
MATCHES=( dist/beqdesigner_* )
echo "binary_path=${MATCHES[0]}" >> $GITHUB_OUTPUT
echo "binary_name=${MATCHES[0]:5}" >> $GITHUB_OUTPUT
echo "binary_content_type=application/octet-stream" >> $GITHUB_OUTPUT
fi
- name: Upload beqdesigner
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: ${{ steps.create_dist.outputs.binary_name }}
asset_path: ${{ steps.create_dist.outputs.binary_path }}
asset_content_type: ${{ steps.create_dist.outputs.binary_content_type }}