Skip to content

Commit cbfce97

Browse files
committed
Use new precommit driver for CI testing
1 parent 1603b74 commit cbfce97

2 files changed

Lines changed: 44 additions & 13 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Precommit
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
test:
13+
name: Precommit
14+
runs-on: X64
15+
if: github.repository_owner == 'deepmodeling'
16+
container:
17+
image: ghcr.io/deepmodeling/abacus-gnu
18+
volumes:
19+
- /tmp/ccache:/github/home/.ccache
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v6
23+
with:
24+
fetch-depth: 0
25+
# We will handle submodules manually after fixing ownership
26+
submodules: 'false'
27+
28+
- name: Take ownership of the workspace and update submodules
29+
run: |
30+
sudo chown -R $(whoami) .
31+
git submodule update --init --recursive
32+
33+
- name: Configure precommit server
34+
run: |
35+
cd tools/precommit
36+
./start_local_server.sh &
37+
38+
- name: Run precommit
39+
env:
40+
ABACUS_PRECOMMIT_SERVER: "http://127.0.0.1:8080"
41+
run: |
42+
./tools/precommit/precommit.py --no-cache
43+

.github/workflows/test.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,12 @@ jobs:
3232
- name: Install CI tools
3333
run: |
3434
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
35+
sudo apt-get install -y ccache ca-certificates python-is-python3
3736
3837
- name: Configure
3938
run: |
4039
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
4140
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-
5341
- name: Build
5442
run: |
5543
cmake --build build -j8

0 commit comments

Comments
 (0)