Skip to content

Scheduled monthly dependency update for July #251

Scheduled monthly dependency update for July

Scheduled monthly dependency update for July #251

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu
runs_on: ubuntu-latest
- name: macos
runs_on: macos-11
# - name: windows
# runs_on: windows-latest
runs-on: ${{ matrix.runs_on }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -r requirements.txt
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Install libraries
# if: ${{ matrix.runs_on == 'macos-latest' }}
# run: |
# echo $PWD
# ls
# cd src/pysme/smelib
# python -c "from libtools import download_libsme; download_libsme()"
# cd ../lib
# install_name_tool -id $PWD/libsme.5.dylib libsme.5.dylib
# install_name_tool -id $PWD/libsme.dylib libsme.dylib
# install_name_tool -id $PWD/sme_synth.so.darwin.x86_64.64 sme_synth.so.darwin.x86_64.64
# cd ../smelib
# python -c "from libtools import compile_interface; compile_interface()"
# echo $PWD
- name: Test with pytest
run: pytest
- name: GitHub Tag
if: github.event_name != 'pull_request' && matrix.name == 'ubuntu'
id: tag_release
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
if: github.event_name != 'pull_request' && matrix.name == 'ubuntu'
with:
ref: ${{ steps.tag_release.outputs.new_tag }}
clean: false
- name: Build Wheel
if: matrix.name == 'ubuntu'
run: pip install wheel && python setup.py sdist bdist_wheel
- name: Zip data
if: matrix.name == 'ubuntu'
id: zip_data
run: zip -r dist dist && echo "::set-output name=filename::dist.zip"
- name: Create Release
if: github.event_name != 'pull_request' && matrix.name == 'ubuntu'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.tag_release.outputs.new_tag }}
release_name: Release ${{ steps.tag_release.outputs.new_tag }}
draft: false
prerelease: false
- name: Upload Release Asset
if: github.event_name != 'pull_request' && matrix.name == 'ubuntu'
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist.zip
asset_name: dist.zip
asset_content_type: application/zip
- name: Publish a Python distribution to PyPI
if: github.event_name != 'pull_request' && matrix.name == 'ubuntu'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}