forked from Borklet-Labs/axlearn
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (39 loc) · 1.39 KB
/
Copy pathpre-commit.yml
File metadata and controls
44 lines (39 loc) · 1.39 KB
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
name: pre-commit
permissions:
contents: read
on: [pull_request, merge_group]
jobs:
pre-commit:
runs-on: ubuntu-latest
# resource_class: large
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install --upgrade pip
- run: pip install uv
- run: uv venv
- run: |
echo ".venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
# TODO(markblee): Remove gcp,vertexai_tensorboard from CI. (needed by pytype)
- run: uv pip install '.[core,audio,orbax,dev,gcp,vertexai_tensorboard,open_api]'
# pylint uses approx 12GB of memory during this run, look into split to decrease?
- run: |
# Start memory monitor as a background process.
{ .github/scripts/monitor_memory.sh & } || true
MONITOR_PID=$!
# A short sleep to wait for monitor process to start.
sleep 1
# Start pre-commit check.
echo "====== Starting pre-commit... ======"
pre-commit run --all-files
echo "====== pre-commit completed. ======"
# Clean up memory monitor process.
if kill -0 $MONITOR_PID 2>/dev/null; then
echo "Manually stopping monitor process..."
kill $MONITOR_PID || true
fi
- run: pytype -j auto axlearn