Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
43 changes: 0 additions & 43 deletions .clang-tidy

This file was deleted.

12 changes: 6 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// To develop inside a pre-configured container, see https://code.visualstudio.com/docs/remote/containers .
// For format details, see https://aka.ms/devcontainer.json .
{
"image":"ghcr.io/deepmodeling/abacus-gnu",
"extensions": [
"ms-vscode.cpptools-extension-pack",
"xaver.clang-format",
"cschlosser.doxdocgen"
]
"image":"ghcr.io/deepmodeling/abacus-gnu",
"extensions": [
"ms-vscode.cpptools-extension-pack",
"xaver.clang-format",
"cschlosser.doxdocgen"
]
}
62 changes: 62 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Precommit

on:
workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Precommit
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
# We will handle submodules manually after fixing ownership
submodules: 'false'

- name: Update submodules
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git submodule update --init --recursive

- name: Configure precommit server
run: |
cd tools/precommit
./start_local_server.sh &

- name: Wait for precommit server
run: |
for i in {1..300}; do
if curl -fs -o /dev/null http://127.0.0.1:8080/ 2>/dev/null; then
echo "precommit server is ready"
exit 0
fi
sleep 1
done

echo "precommit server did not become ready" >&2
echo "==== precommit server log ====" >&2
cat "$RUNNER_TEMP/precommit-server.log" >&2 || true
exit 1

- name: Run precommit
env:
ABACUS_PRECOMMIT_SERVER: "http://127.0.0.1:8080"
run: |
if ! ./tools/precommit/precommit.py --no-cache; then
echo ""
echo "********************************************"
echo "* *"
echo "* O/ Try running ./make_pretty.sh *"
echo "* /| *"
echo "* / \\ *"
echo "********************************************"
echo ""
exit 1
fi
14 changes: 1 addition & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,12 @@ jobs:
- name: Install CI tools
run: |
sudo apt-get update
sudo apt-get install -y ccache ca-certificates python-is-python3 python3-pip
sudo pip install clang-format clang-tidy
sudo apt-get install -y ccache ca-certificates python-is-python3

- name: Configure
run: |
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

# Temporarily removed because no one maintains this now.
# And it will break the CI test workflow.

# - uses: pre-commit/action@v3.0.1
# with:
# extra_args:
# --from-ref ${{ github.event.pull_request.base.sha }}
# --to-ref ${{ github.event.pull_request.head.sha }}
# continue-on-error: true
# - uses: pre-commit-ci/lite-action@v1.0.3

- name: Build
run: |
cmake --build build -j8
Expand Down
Loading
Loading