Skip to content

♻️👷 Refactor CICD Pipeline #3357

♻️👷 Refactor CICD Pipeline

♻️👷 Refactor CICD Pipeline #3357

Workflow file for this run

name: Python code style check
on:
pull_request:
branches:
- master
permissions: {}
jobs:
style:
name: style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Overwrite .mise.toml # It's not needed in this workflow
run: |
cat <<EOF > .mise.toml
[tools]
"pipx:black" = "25.1"
"pipx:isort" = "6.0"
python = "3.12"
uv = "0.5"
[settings]
pipx_uvx = true
EOF
- name: Set up Mise
uses: jdx/mise-action@v2
with:
cache: true
experimental: true
install: true
- name: Check import style with isort
run: isort . --check --profile black --diff
- name: Check code style with Black
run: black . --check --diff
- name: Check Tiltfiles with Black
run: |
find . -type f -name "Tiltfile" | while read -r file; do
black --check --diff "$file"
done
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Overwrite .mise.toml # Simplify mise in this workflow
run: |
cat <<EOF > .mise.toml
[tools]
poetry = "2.0"
python = "3.12"
uv = "0.5"
[settings]
experimental = true
pipx_uvx = true
python_compile = false
[env]
# Use Python/Mise managed virtual environment
POETRY_VIRTUALENVS_CREATE = "false"
# Setup Python Virtual Environment
_.python.venv = { path = ".venv", create = true }
[tasks."poetry:install"]
description = "Poetry Install dependencies for all submodules"
depends = ["poetry:install:*"]
EOF
- name: Set up Mise
uses: jdx/mise-action@v2
with:
cache: true
experimental: true
install: true
- name: Load Mise env
run: |
mise env -s bash \
| grep -v 'export PATH=' \
| cut -d' ' -f2 \
>> "$GITHUB_ENV"
- name: Install dependencies with Poetry
run: mise run poetry:install
env:
MISE_JOBS: 1
- name: Run Pylint
run: |
poetry run pylint \
app/ \
endorser/ \
shared/ \
trustregistry/ \
waypoint/ \
--rcfile=.pylintrc \
-r n \
--msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
--exit-zero | tee pylintreport.txt