Skip to content

fix(process): forcefully disable multiprocessing if the user's machine is bad #2175

fix(process): forcefully disable multiprocessing if the user's machine is bad

fix(process): forcefully disable multiprocessing if the user's machine is bad #2175

Workflow file for this run

name: Post Commit Checks and Pushes
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
workflow_dispatch:
permissions:
contents: write # Needed for push
pull-requests: write # Needed for PR comments
env:
MAIN_REPO: "NSPC911/rovr"
jobs:
format_and_push_changes:
runs-on: ubuntu-slim
if: github.event_name != 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
with:
activate-environment: true
- name: Install dependencies
run: uv sync --all-groups --no-group build
- name: Run ty
run: uv run ty check
- name: Run ruff format if needed (main repo)
if: github.repository == env.MAIN_REPO && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
run: |
uv run ruff format .
uv run ruff check --fix --unsafe-fixes
- name: Commit and push changes if needed (main repo)
if: github.repository == env.MAIN_REPO && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
run: |
git config --global user.name "${GITHUB_ACTOR_NAME:-NSPBot911}"
git config --global user.email "${GITHUB_ACTOR_EMAIL:-176916861+NSPBot911@users.noreply.github.com}"
git add .
if ! git diff --cached --quiet; then
git commit -m "style: auto-format with ruff" -m "[skip ci]" -m "${{ GITHUB.ACTOR }} forgot to run ruff format" -m "skip-checks: true"
git push
fi
env:
GITHUB_ACTOR_NAME: ${{ vars.BOT_NAME || 'NSPBot911' }}
GITHUB_ACTOR_EMAIL: ${{ vars.BOT_EMAIL || '176916861+NSPBot911@users.noreply.github.com' }}
- name: Run docs scripts
run: |
uv run poe gen-schema
uv run poe gen-keys
uv run poe typed
# need to do ruff because type hints use scuffed configs
uv run ruff format .
uv run ruff check --fix --unsafe-fixes
- name: Commit and push changes if needed (main repo)
if: github.repository == env.MAIN_REPO && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
run: |
git config --global user.name "${GITHUB_ACTOR_NAME:-NSPBot911}"
git config --global user.email "${GITHUB_ACTOR_EMAIL:-176916861+NSPBot911@users.noreply.github.com}"
git add .
if ! git diff --cached --quiet; then
git commit -m "docs: generate things" -m "[skip ci]" -m "${{ GITHUB.ACTOR }} forgot to run some scripts" -m "skip-checks: true"
git push
fi
env:
GITHUB_ACTOR_NAME: ${{ vars.BOT_NAME || 'NSPBot911' }}
GITHUB_ACTOR_EMAIL: ${{ vars.BOT_EMAIL || '176916861+NSPBot911@users.noreply.github.com' }}
- name: Alert if fail
if: failure()
uses: sarisia/actions-status-discord@v1.16.0
with:
webhook: ${{ secrets.LOG_HOOK }}
title: Post Commit checks failed!
status: failure
description: "Check the workflow [details](https://github.com/NSPC911/rovr/actions/runs/${{ github.run_id }}) for more info."
avatar_url: "https://avatars.githubusercontent.com/u/176916861?v=4"
username: "NSPBot911"
nodetail: true
notimestamp: true
noprefix: true
format_and_alert:
runs-on: ubuntu-slim
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
with:
activate-environment: true
- name: Install dependencies
run: uv sync --all-groups --no-group build
- name: Run ty
id: ty_check
run: uv run ty check || (echo "::error::Type checking failed! Please fix type errors before committing." && exit 1)
- name: Alert if ty fails
if: failure() && steps.ty_check.outcome == 'failure'
uses: sarisia/actions-status-discord@v1.16.0
with:
webhook: ${{ secrets.LOG_HOOK }}
title: rovr ty check failed!
status: failure
description: |
<:wazowski:1308074746772062248> Type checking failed on branch `${{ github.ref_name }}` (due to `${{ github.event_name }}`)
Check the workflow [details](https://github.com/NSPC911/rovr/actions/runs/${{ github.run_id }}) for more info.
avatar_url: "https://avatars.githubusercontent.com/u/176916861?v=4"
username: "NSPBot911"
nodetail: true
notimestamp: true
noprefix: true
# If on a fork, only check and fail if there are issues (no fixes/commits)
- name: Run ruff
id: ruff_check
uses: astral-sh/ruff-action@v4.0.0
- name: Alert if ruff fails
if: failure() && steps.ruff_check.outcome == 'failure'
uses: sarisia/actions-status-discord@v1.16.0
with:
webhook: ${{ secrets.LOG_HOOK }}
title: rovr ruff check failed!
status: failure
description: |
<:wazowski:1308074746772062248> Code formatting/linting failed on branch `${{ github.ref_name }}` (due to `${{ github.event_name }}`)
Check the workflow [details](https://github.com/NSPC911/rovr/actions/runs/${{ github.run_id }}) for more info.
avatar_url: "https://avatars.githubusercontent.com/u/176916861?v=4"
username: "NSPBot911"
nodetail: true
notimestamp: true
noprefix: true