Skip to content

LORIS-MRI tooling configuration (Docker version) #19

LORIS-MRI tooling configuration (Docker version)

LORIS-MRI tooling configuration (Docker version) #19

Workflow file for this run

name: Python checks
on:
- push
- pull_request
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./test/python.Dockerfile
build-args: |
PYTHON-VERSION=${{ matrix.python-version }}
push: true
tags: ghcr.io/maximemulder/python:${{ matrix.python-version }}
# tags: ghcr.io/${{ github.repository_owner }}/python:${{ matrix.python-version }}
cache-from: type=gha
cache-to: type=gha
ruff:
name: Ruff
runs-on: ubuntu-latest
needs: docker
strategy:
matrix:
python-version: ["3.11", "3.12"]
container:
image: ghcr.io/maximemulder/python:${{ matrix.python-version }}
# image: ghcr.io/${{ github.repository_owner }}/python:${{ matrix.python-version }}
steps:
- name: Checkout LORIS-MRI
uses: actions/checkout@v4
- name: Run Ruff
run: ruff check --output-format=github
pyright-strict:
name: Pyright strict
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
container:
image: ghcr.io/maximemulder/python:${{ matrix.python-version }}
# image: ghcr.io/${{ github.repository_owner }}/python:${{ matrix.python-version }}
steps:
- name: Check out LORIS-MRI
uses: actions/checkout@v4
# The `jq` arcane is used to translate the errors from JSON to the GitHub actions format
- name: Run Pyright
run: |
pyright --outputjson | jq -r '.generalDiagnostics[] | "::error file=\(.file),line=\(.range.start.line),col=\(.range.start.character)::\(.message)"'
(exit ${PIPESTATUS[0]})
pyrigh-global:
name: Pyright global
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
container:
image: ghcr.io/maximemulder/python:${{ matrix.python-version }}
# image: ghcr.io/${{ github.repository_owner }}/python:${{ matrix.python-version }}
steps:
- name: Check out LORIS-MRI
uses: actions/checkout@v4
# The `jq` arcane is used to translate the errors from JSON to the GitHub actions format
- name: Run Pyright
run: |
cd test
pyright --outputjson | jq -r '.generalDiagnostics[] | "::error file=\(.file),line=\(.range.start.line),col=\(.range.start.character)::\(.message)"'
(exit ${PIPESTATUS[0]})