Skip to content

Commit 7223a71

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

2 files changed

Lines changed: 39 additions & 13 deletions

File tree

.github/workflows/precommit.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Precommit
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
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: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v6
18+
with:
19+
fetch-depth: 0
20+
# We will handle submodules manually after fixing ownership
21+
submodules: 'false'
22+
23+
- name: Update submodules
24+
run: |
25+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
26+
git submodule update --init --recursive
27+
28+
- name: Configure precommit server
29+
run: |
30+
cd tools/precommit
31+
./start_local_server.sh &
32+
33+
- name: Run precommit
34+
env:
35+
ABACUS_PRECOMMIT_SERVER: "http://127.0.0.1:8080"
36+
run: |
37+
./tools/precommit/precommit.py --no-cache
38+

.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)