Skip to content

chore(deps-dev): bump flake8-bugbear from 24.4.26 to 24.8.19 #348

chore(deps-dev): bump flake8-bugbear from 24.4.26 to 24.8.19

chore(deps-dev): bump flake8-bugbear from 24.4.26 to 24.8.19 #348

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: 01_ci-cd
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: build
runs-on: ubuntu-latest
needs: [ i18n ]
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pipenv
pipenv install --dev --ignore-pipfile
- name: Unit tests
run: |
pipenv run pytest -svv tests/ --junitxml=junit/unit-test-results-3.11.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: unit-test-results-3.11
path: junit/unit-test-results-3.11.xml
- name: Publish Test Result
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: junit/unit-test-results-3.11.xml
check_name: Unit Tests
- uses: ./.github/actions/download-i18n
- name: build artifact
run: |
python -m pip install wheel
python setup.py sdist bdist_wheel
- uses: actions/upload-artifact@v4
with:
name: hexagon-${{ github.sha }}
path: dist/*.tar.gz
test:
name: test
runs-on: ${{ matrix.os }}
needs: [ i18n, build ]
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/download-artifact@v4
with:
name: hexagon-${{ github.sha }}
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist
- uses: ./.github/actions/download-i18n
- name: Setup e2e dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
artifact=$(ls dist/*.tar.gz)
python -m pip install $artifact
- name: e2e tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 3
max_attempts: 3
retry_on: error
command: |
echo "Running e2e tests for Python ${{ matrix.python-version }}"
echo "COLUMNS: $COLUMNS, ROWS: $ROWS"
pytest -svv tests_e2e/ --junitxml=junit/e2e-test-results-${{ matrix.python-version }}.xml
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-test-results-${{ matrix.os }}-${{ matrix.python-version }}
path: junit/e2e-test-results-${{ matrix.python-version }}.xml
- name: Publish Test Result
uses: EnricoMi/publish-unit-test-result-action@v2
if: always() && matrix.os == 'ubuntu-latest'
continue-on-error: true
with:
files: junit/e2e-test-results-${{ matrix.python-version }}.xml
check_name: E2E Tests Python${{ matrix.python-version }}
- name: Publish Test Result MacOS
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: always() && matrix.os == 'macos-latest'
continue-on-error: true
with:
files: junit/e2e-test-results-${{ matrix.python-version }}.xml
check_name: E2E Tests Python${{ matrix.python-version }}
i18n:
name: i18n
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install gettext
run: sudo apt-get install -y gettext
- name: add matcher
run: echo "::add-matcher::.github/i18n-problem-matcher.json"
- name: build locales
run: .github/scripts/i18n/build.sh
- name: validate translations
run: .github/scripts/i18n/check.sh
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: i18n
path: locales/**/*.mo
- name: remove matcher
run: echo "::remove-matcher owner=hexagon-i18n::"
release:
if: ${{ github.event_name != 'pull_request' && github.event_name != 'pull_request_target' }}
runs-on: ubuntu-latest
needs: [ build, test, i18n ]
environment:
name: pypi
url: https://pypi.org/project/hexagon/
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.USER_TOKEN }}
- uses: ./.github/actions/download-i18n
- name: Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package distributions to GitHub Releases
id: github-release
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
uses: python-semantic-release/upload-to-gh-release@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}
# see https://docs.pypi.org/trusted-publishers/
- name: Publish package distributions to PyPI
id: pypi-publish
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
# See https://github.com/actions/runner/issues/1173
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
nightly:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }}
runs-on: ubuntu-latest
needs: [ test ]
permissions:
pull-requests: write
steps:
- uses: marocchino/sticky-pull-request-comment@v2
with:
header: nightly
message: |
## Beta Available!
:rocket: see nightly build [details](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/hexagon-${{ github.sha }})
Install locally with:
```bash
wget https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/hexagon-${{ github.sha }}.zip && unzip hexagon-${{ github.sha }}.zip && python3 -m pip install --find-links=. hexagon
```