Merge pull request #19 from basler/topic/prepare_upload #10
This file contains hidden or 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
| name: Build and Test | |
| on: | |
| # Trigger the workflow on pushes to main and on version tags in the format X.Y.Z.* | |
| # and on pull requests to main | |
| push: | |
| branches: [main] | |
| tags: ["*.*.*"] | |
| pull_request: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build tools | |
| run: pip install build setuptools-scm | |
| - name: Build wheel | |
| run: python -m build --wheel | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pypylon-contrib-wheel | |
| path: dist/*.whl | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Run tests | |
| run: | | |
| pytest tests | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
| 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 dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ".[dev]" | |
| - name: Run pylint | |
| run: | | |
| pylint src --fail-under=10.0 | |
| - name: Run ruff | |
| run: | | |
| ruff check src --output-format=github | |