Use changelog snippets #39
Workflow file for this run
This file contains 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
--- | |
# This workflow will install Python dependencies, run tests and lint with a | |
# specific Python version | |
# For more information see: | |
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Test Python package | |
on: | |
push: | |
# branches: [ $default-branch ] | |
branches-ignore: | |
- 'main' | |
- 'develop' | |
pull_request: | |
branches: | |
- 'main' | |
- 'develop' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
# all history is needed to crawl it properly | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install test dependencies | |
run: | | |
pip install -r requirements-test.txt | |
- name: Lint with flake8 | |
run: | | |
flake8 . | |
- name: Lint with yamllint | |
run: | | |
yamllint . | |
- name: Update changelog with snippets | |
run: | | |
changelog-generator \ | |
changelog changelog.md \ | |
--snippets=.snippets \ | |
--in-place | |
- name: Validate package version file | |
# the package version file has to be always up to date as mip is using | |
# the file directly from the repo. On a PyPi package the version file | |
# is updated and then packed | |
run: | | |
changelog2version \ | |
--changelog_file changelog.md \ | |
--version_file be_upy_blink/version.py \ | |
--version_file_type py \ | |
--validate \ | |
--debug | |
- name: Validate mip package file | |
run: | | |
upy-package \ | |
--setup_file setup.py \ | |
--package_changelog_file changelog.md \ | |
--package_file package.json \ | |
--validate | |
# use --ignore-version to skip version validation | |
# use --ignore-deps to skip dependency validation | |
# use --ignore-boot-main to skip boot.py and main.py files in URLs | |
- name: Install deploy dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi | |
- name: Build package | |
run: | | |
python setup.py sdist | |
rm dist/*.orig | |
- name: Test built package | |
run: | | |
twine check dist/* |