Clean up main.yml #1453
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
GC_FREE_SPACE_DIVISOR: 10 | |
PYTHONUNBUFFERED: TRUE | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
lilypond-version: ["2.25.23"] | |
python-version: ["3.12", "3.13"] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pip | |
key: > | |
${{ runner.os }}-pip- | |
${{ matrix.python-version }}- | |
${{ hashFiles('ci/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ matrix.python-version }}- | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- name: Write environment variables | |
run: | | |
PATH="/tmp/lilypond-${{ matrix.lilypond-version }}/bin:home/runner/bin:$PATH" | |
echo "PATH=$PATH" >> $GITHUB_ENV | |
- name: Log environment variables | |
run: | | |
echo "HOME: $HOME" | |
echo "GC_FREE_SPACE_DIVISOR: $GC_FREE_SPACE_DIVISOR" | |
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" | |
echo "PATH: $PATH" | |
echo "PYTHONUNBUFFERED: ${PYTHONUNBUFFERED:-not set}" | |
echo "PYTHONPATH: ${PYTHONPATH:-not set}" | |
- name: Install LilyPond | |
uses: Abjad/install-lilypond@main | |
with: | |
lilypond-version: ${{ matrix.lilypond-version }} | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r ci/requirements.txt --no-cache-dir | |
- name: Install Abjad trevor/dev branch | |
run: | | |
git clone -b trevor/dev https://github.com/Abjad/abjad.git /tmp/abjad | |
# include -e for access to abjad/scr/prime_parser_tables.py | |
python -m pip install -e /tmp/abjad | |
- name: Prime parser tables | |
run: | | |
/tmp/abjad/scr/prime_parser_tables.py | |
- name: Install rmakers | |
run: | | |
git clone https://github.com/Abjad/abjad-ext-rmakers.git /tmp/abjad-ext-rmakers | |
python -m pip install /tmp/abjad-ext-rmakers | |
- name: Install Bača | |
run: | | |
git clone https://github.com/trevorbaca/baca.git /tmp/baca | |
# include -e for access to baca/scr/doctest, test-sections, ... | |
python -m pip install -e /tmp/baca | |
- name: Install this package | |
run: | | |
python -m pip install . | |
- name: Log Python dependencies | |
run: | | |
black --version | |
flake8 --version | |
isort --version | |
pip --version | |
pytest --version | |
- name: Run checks | |
run: | | |
make black-check | |
make flake8 | |
make isort-check | |
- name: Run doctest | |
run: | | |
/tmp/baca/scr/doctest $GITHUB_WORKSPACE | |
- name: Set cores to get stored in /cores | |
run: | | |
sudo mkdir /cores | |
sudo chmod 777 /cores | |
sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern' | |
- name: Test sections | |
run: | | |
ulimit -c unlimited | |
/tmp/baca/scr/test-sections | |
- name: Test score builds | |
run: | | |
NAME=$(basename $GITHUB_WORKSPACE) | |
BUILDS_DIRECTORY=$GITHUB_WORKSPACE/$NAME/builds | |
if [ -d $BUILDS_DIRECTORY ]; then | |
cd $BUILDS_DIRECTORY | |
/tmp/baca/scr/test-score-build-music | |
fi | |
cd $GITHUB_WORKSPACE | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: cores | |
path: /cores |