name: Pre-commit checks on: workflow_call: permissions: contents: read packages: read jobs: link-check: if: github.repository == 'learning-process/parallel_programming_course' runs-on: ubuntu-26.04 steps: - uses: actions/checkout@v7 - name: Check links uses: lycheeverse/lychee-action@v2 with: fail: false # TODO: Change to true after dealing with sporadic link failures failIfEmpty: false args: >- --max-retries 5 --retry-wait-time 2 --timeout 30 --host-concurrency 3 --host-request-interval 200ms './**/*.md' './**/*.html' './**/*.rst' pre-commit: runs-on: ubuntu-26.04 container: image: ghcr.io/learning-process/ppc-ubuntu:1.3 credentials: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} steps: - name: Check pull request description if: >- github.event_name == 'pull_request' && contains( github.event.pull_request.body, 'Please go to the `Preview` tab and select the appropriate template:') run: exit 1 - uses: actions/checkout@v7 with: submodules: recursive fetch-depth: 0 - uses: actions/setup-python@v7 with: python-version: "3.14" - name: Setup environment run: | python3 -m pip install -r requirements.txt --break-system-packages --ignore-installed - name: Install Docker CLI run: | apt-get update apt-get install -y --no-install-recommends docker.io rm -rf /var/lib/apt/lists/* - name: Configure git safe directory run: | git config --global --add safe.directory '*' - name: Run pre-commit checks run: | FROM_REF="${{ github.base_ref || 'HEAD~1' }}" git fetch origin $FROM_REF:$FROM_REF || true pre-commit run --from-ref $FROM_REF --to-ref HEAD