ci(python): Add permission #175
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: Python building | |
permissions: | |
contents: read | |
on: | |
push: | |
branches: [ "async_dev" ] | |
pull_request: | |
branches: [ "async_dev" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.13"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: true | |
- name: Install dependencies | |
run: | | |
pdm install -d | |
#- name: Run pyright | |
# uses: jakebailey/pyright-action@v1 | |
- name: Run mypy | |
run: | | |
source .venv/bin/activate | |
mypy src tests | |
- name: Run ruff | |
run: | | |
source .venv/bin/activate | |
ruff check src tests --output-format=full --show-fixes --ignore FIX | |
- name: Run unittest | |
run: | | |
source .venv/bin/activate | |
python -m unittest | |
- name: Build package | |
if: ${{ always() }} | |
id: build | |
run: | | |
pdm build | |
echo "exit_code=$?" >> $GITHUB_OUTPUT | |
- uses: actions/upload-artifact@v4 | |
if: ${{ always() }} # steps.build.outputs.exit_code == 0 | |
with: | |
name: dist-${{ matrix.python-version }} | |
path: dist/* |