Check formatting #142
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: Check formatting | |
| on: | |
| workflow_call: | |
| inputs: | |
| tag: | |
| description: "Tag of DOLFINx docker image" | |
| default: "nightly" | |
| required: true | |
| type: string | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag of DOLFINx docker image" | |
| default: "nightly" | |
| required: true | |
| type: string | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 8 * * *" | |
| env: | |
| DEB_PYTHON_INSTALL_LAYOUT: deb_system | |
| DEFAULT_TAG: nightly | |
| jobs: | |
| get_image_tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image: ${{ steps.docker_tag.outputs.image }} | |
| steps: | |
| - id: docker_tag | |
| run: echo "image=${{ inputs.tag || env.DEFAULT_TAG }}" >> $GITHUB_OUTPUT | |
| build: | |
| needs: get_image_tag | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/fenics/dolfinx/dolfinx:${{ needs.get_image_tag.outputs.image }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Update pip | |
| run: python3 -m pip install --upgrade pip setuptools | |
| - name: Install code | |
| run: python3 -m pip install .[dev] | |
| - name: Check code formatting with ruff | |
| run: | | |
| ruff check . | |
| ruff format --check . | |
| - name: Mypy check | |
| run: python3 -m mypy -v |