Skip to content

Day 22: Speed up with Cython #76

Day 22: Speed up with Cython

Day 22: Speed up with Cython #76

Workflow file for this run

name: Python CI
on:
push:
branches: [ main ]
paths: [ py/**, .github/workflows/py.yml ]
pull_request:
branches: [ main ]
paths: [ py/**, .github/workflows/py.yml ]
workflow_dispatch:
jobs:
get-inputs:
uses: ephemient/aoc2024/.github/workflows/get-inputs.yml@main
secrets:
SESSION: ${{ secrets.SESSION }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snok/install-poetry@v1
- uses: actions/setup-python@v5
with:
python-version: 3.13
cache: poetry
- run: poetry install --no-interaction
working-directory: py
- run: poetry run ruff check
working-directory: py
- run: poetry run ruff format --check
working-directory: py
- run: poetry run pytest --benchmark-skip
working-directory: py
- run: poetry build
working-directory: py
- uses: actions/upload-artifact@v4
with:
name: aoc2024-py
path: py/dist/*
wheel:
needs: [ build ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v2
if: runner.os == 'Linux'
with:
platforms: all
- uses: pypa/[email protected]
with:
package-dir: py
env:
CIBW_ARCHS_LINUX: aarch64 i686 ppc64le s390x x86_64
CIBW_ARCHS_MACOS: universal2 x86_64
CIBW_BUILD: cp313-*
CIBW_BUILD_FRONTEND: build
- uses: actions/upload-artifact@v4
with:
name: aoc2024-py-${{ matrix.os }}
path: py/wheelhouse/*
run:
needs: [ get-inputs, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- run: |
python -m venv .
. bin/activate
pip install *.whl
working-directory: aoc2024-py
- run: aoc2024-py/bin/aoc2024
env:
AOC2024_DATADIR: inputs
PYTHON_HOME: aoc2024-py