-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (114 loc) · 3.57 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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