Skip to content

Commit b584390

Browse files
committed
check in cargo.lock for caching; introduce async runtime
uses tokio to spawn tasks for running clang-format/tidy on each file
1 parent 8a05e13 commit b584390

21 files changed

+2102
-164
lines changed

.gitattributes

+8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@
55
# to native line endings on checkout.
66
*.py text eol=lf
77
*.rst text eol=lf
8+
*.css text eol=lf
89
*.md text eol=lf
910
*.rs text eol=lf
1011
*.yaml text eol=lf
1112
*.toml text eol=lf
13+
*.lock text eol=lf
1214
*.yml text eol=lf
1315
*.sh text eol=lf
1416
*.cpp text eol=lf
1517
*.hpp text eol=lf
1618
*.patch text eol=lf
19+
*.diff text eol=lf
1720
.gitattributes text eol=lf
21+
.gitmodules text eol=lf
22+
.gitignore text eol=lf
1823
*.txt text eol=lf
24+
*.json text eol=lf
1925
*.code-workspace text eol=lf
26+
*.clang-tidy text eol=lf
27+
*.clang-format text eol=lf

.github/workflows/build-docs.yml

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: [push, workflow_dispatch]
55
jobs:
66
build-sphinx:
77
runs-on: ubuntu-latest
8+
needs: [build-rustdoc]
89
steps:
910
- uses: actions/checkout@v4
1011
- uses: actions/setup-python@v5
@@ -15,6 +16,12 @@ jobs:
1516
working-directory: cpp-linter-py
1617
run: pip install -r docs/requirements.txt
1718

19+
- name: Cache .cargo locked resources
20+
uses: actions/cache@v4
21+
with:
22+
path: ~/.cargo
23+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
24+
1825
- name: Build docs
1926
working-directory: cpp-linter-py
2027
run: sphinx-build docs docs/_build/html
@@ -38,6 +45,11 @@ jobs:
3845
steps:
3946
- uses: actions/checkout@v4
4047
- run: rustup update --no-self-update
48+
- name: Cache .cargo locked resources
49+
uses: actions/cache@v4
50+
with:
51+
path: ~/.cargo
52+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
4153
- run: cargo doc --no-deps --manifest-path cpp-linter-lib/Cargo.toml
4254
- name: upload rustdoc build as artifact
4355
uses: actions/upload-artifact@v4

.github/workflows/pre-commit-hooks.yml

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717
- run: rustup update
18+
- name: Cache .cargo locked resources
19+
uses: actions/cache@v4
20+
with:
21+
path: ~/.cargo
22+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
1823
- name: cargo clippy
1924
run: cargo clippy
2025
- name: cargo fmt

.github/workflows/run-dev-tests.yml

+6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ jobs:
8787
python -m pip install clang-tools
8888
clang-tools --install ${{ matrix.version }}
8989
90+
- name: Cache .cargo locked resources
91+
uses: actions/cache@v4
92+
with:
93+
path: ~/.cargo
94+
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
95+
9096
- name: Collect Coverage
9197
working-directory: cpp-linter-lib
9298
env:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ debug/
180180

181181
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
182182
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
183-
Cargo.lock
183+
# Cargo.lock
184184

185185
# These are backup files generated by rustfmt
186186
**/*.rs.bk

0 commit comments

Comments
 (0)