forked from verl-project/verl-omni
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (50 loc) · 1.73 KB
/
Copy pathpre-commit.yml
File metadata and controls
53 lines (50 loc) · 1.73 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
45
46
47
48
49
50
51
52
53
# c.f. https://github.com/pre-commit/action?tab=readme-ov-file#using-this-action
name: pre-commit
# No need to avoid / cancel lightweight pre-commit jobs
on:
schedule:
- cron: "0 0 * * 0"
pull_request:
types: [labeled]
push:
branches:
- main
- v0.*
# Allow manual triggering
workflow_dispatch:
# Declare permissions just read content.
permissions:
contents: read
jobs:
pre-commit:
if: >-
github.event_name != 'pull_request' ||
contains(join(github.event.pull_request.labels.*.name, ','), 'ci')
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
pyproject.toml
.github/verl_pin.txt
- name: Install the current repository
run: |
pip install pre-commit hydra-core
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install "ray" "tensordict"
pip install --no-deps "verl @ git+https://github.com/verl-project/verl.git@$(cat .github/verl_pin.txt)"
pip install --no-deps -e .
- name: Set ruff --output-format=github
run: |
sed -i 's/--output-format=full/--output-format=github/' .pre-commit-config.yaml
git add .pre-commit-config.yaml
# Check "--all-files" by default
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1