File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Lint
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - nightly
8
+ - main
9
+ - release/*
10
+ workflow_dispatch :
11
+
12
+ jobs :
13
+ python-source-and-configs :
14
+ uses : pytorch/test-infra/.github/workflows/linux_job.yml@main
15
+ with :
16
+ repository : pytorch/rl
17
+ script : |
18
+ set -euo pipefail
19
+
20
+ echo '::group::Setup environment'
21
+ CONDA_PATH=$(which conda)
22
+ eval "$(${CONDA_PATH} shell.bash hook)"
23
+ conda create --name ci --quiet --yes python=3.8 pip
24
+ conda activate ci
25
+ echo '::endgroup::'
26
+
27
+ echo '::group::Install lint tools'
28
+ pip install --progress-bar=off pre-commit
29
+ echo '::endgroup::'
30
+
31
+ echo '::group::Lint Python source and configs'
32
+ set +e
33
+ pre-commit run --all-files
34
+
35
+ if [ $? -ne 0 ]; then
36
+ git --no-pager diff
37
+ exit 1
38
+ fi
39
+ echo '::endgroup::'
40
+
41
+ c-source :
42
+ uses : pytorch/test-infra/.github/workflows/linux_job.yml@main
43
+ with :
44
+ repository : pytorch/rl
45
+ script : |
46
+ set -euo pipefail
47
+
48
+ echo '::group::Setup environment'
49
+ CONDA_PATH=$(which conda)
50
+ eval "$(${CONDA_PATH} shell.bash hook)"
51
+ conda create --name ci --quiet --yes -c conda-forge python=3.8 ncurses=5 libgcc
52
+ conda activate ci
53
+ export LD_LIBRARY_PATH="${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}"
54
+ echo '::endgroup::'
55
+
56
+ echo '::group::Install lint tools'
57
+ curl https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/clang-format-linux64 -o ./clang-format
58
+ chmod +x ./clang-format
59
+ echo '::endgroup::'
60
+
61
+ echo '::group::Lint C source'
62
+ set +e
63
+ ./.circleci/unittest/linux/scripts/run-clang-format.py -r torchrl/csrc --clang-format-executable ./clang-format
64
+
65
+ if [ $? -ne 0 ]; then
66
+ git --no-pager diff
67
+ exit 1
68
+ fi
69
+ echo '::endgroup::'
You can’t perform that action at this time.
0 commit comments