Skip to content

Commit 72c4966

Browse files
committed
Split Precommit and Tests
1 parent d936866 commit 72c4966

2 files changed

Lines changed: 49 additions & 11 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Precommit
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test:
12+
name: Precommit
13+
runs-on: X64
14+
if: github.repository_owner == 'deepmodeling'
15+
container:
16+
image: ghcr.io/deepmodeling/abacus-gnu
17+
volumes:
18+
- /tmp/ccache:/github/home/.ccache
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 0
24+
# We will handle submodules manually after fixing ownership
25+
submodules: 'false'
26+
27+
- name: Take ownership of the workspace and update submodules
28+
run: |
29+
sudo chown -R $(whoami) .
30+
git submodule update --init --recursive
31+
32+
- name: Install CI tools
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y ccache ca-certificates python-is-python3 python3-pip
36+
sudo pip install clang-format clang-tidy
37+
38+
- name: Configure
39+
run: |
40+
cmake -B build -DBUILD_TESTING=ON -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
41+
42+
- uses: pre-commit/action@v3.0.1
43+
with:
44+
extra_args:
45+
--from-ref ${{ github.event.pull_request.base.sha }}
46+
--to-ref ${{ github.event.pull_request.head.sha }}
47+
continue-on-error: true
48+
- uses: pre-commit-ci/lite-action@v1.0.3
49+

.github/workflows/test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ jobs:
3939
run: |
4040
cmake -B build -DBUILD_TESTING=ON -DENABLE_MLALGO=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DENABLE_FLOAT_FFTW=ON
4141
42-
# Temporarily removed because no one maintains this now.
43-
# And it will break the CI test workflow.
44-
45-
# - uses: pre-commit/action@v3.0.1
46-
# with:
47-
# extra_args:
48-
# --from-ref ${{ github.event.pull_request.base.sha }}
49-
# --to-ref ${{ github.event.pull_request.head.sha }}
50-
# continue-on-error: true
51-
# - uses: pre-commit-ci/lite-action@v1.0.3
52-
5342
- name: Build
5443
run: |
5544
cmake --build build -j8

0 commit comments

Comments
 (0)