Skip to content

PR review suggestions #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 18, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ updates:
- package-ecosystem: pip
directory: cpp-linter-py/
schedule:
interval: "daily"
interval: "weekly"
groups:
pip:
patterns:
- "*"
- package-ecosystem: cargo
directory: /
schedule:
interval: "daily"
interval: "weekly"
ignore:
- dependency-name: cpp-linter-lib
groups:
Expand Down
192 changes: 132 additions & 60 deletions .github/workflows/run-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,11 @@ env:
RUST_BACKTRACE: 1

jobs:
cache-deps:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- run: rustup update --no-self-update
- uses: actions/checkout@v4
- name: Cache .cargo locked resources
uses: actions/cache@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-test-cargo-${{ hashFiles('Cargo.lock') }}
- run: cargo fetch

test:
needs: [cache-deps]
name: test ${{ matrix.os }} w/ clang v${{ matrix.version }}
strategy:
fail-fast: false
matrix:
os: ['windows-latest', ubuntu-latest]
version: ['17', '16', '15', '14', '13', '12', '11', '10', '9', '8', '7']

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -87,61 +68,152 @@ jobs:
if: runner.os == 'Windows'
run: choco install ninja

- name: Install Linux clang dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
# First try installing from default Ubuntu repositories before trying LLVM script
if ! sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }}; then
# This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/
wget https://apt.llvm.org/llvm.sh -O ${{ runner.temp }}/llvm_install.sh
chmod +x ${{ runner.temp }}/llvm_install.sh
if sudo ${{ runner.temp }}/llvm_install.sh ${{ matrix.version }}; then
sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }}
fi
fi

- name: Install clang-tools
run: |
python -m pip install clang-tools
clang-tools --install ${{ matrix.version }}

- name: Cache .cargo locked resources
uses: actions/cache/restore@v4
with:
path: ~/.cargo
key: ${{ runner.os }}-test-cargo-${{ hashFiles('Cargo.lock') }}

- name: Collect Coverage
working-directory: cpp-linter-lib
- name: Fetch .cargo locked resources
run: cargo fetch

- if: runner.os == 'Linux'
run: sudo apt-get update

- name: Install clang v7
if: matrix.os == 'Linux'
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '7'

- name: Collect Coverage for clang v7
if: matrix.os == 'Linux'
env:
CLANG_VERSION: ${{ matrix.version }}
CLANG_VERSION: '7'
run: just test

- name: Generate Coverage HTML report
working-directory: cpp-linter-lib
- name: Install clang v8
if: matrix.os == 'Linux'
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '8'

- name: Collect Coverage for clang v8
if: matrix.os == 'Linux'
env:
CLANG_VERSION: '8'
run: just test

- name: Install clang v9
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '9'

- name: Collect Coverage for clang v9
env:
CLANG_VERSION: '9'
run: just test

- name: Install clang v10
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '10'

- name: Collect Coverage for clang v10
env:
CLANG_VERSION: '10'
run: just test

- name: Install clang 11
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '11'

- name: Collect Coverage for clang v11
env:
CLANG_VERSION: '11'
run: just test

- name: Install clang 12
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '12'

- name: Collect Coverage for clang v12
env:
CLANG_VERSION: ${{ matrix.version }}
CLANG_VERSION: '12'
run: just test

- name: Install clang 13
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '13'

- name: Collect Coverage for clang v13
env:
CLANG_VERSION: '13'
run: just test

- name: Install clang 14
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '14'

- name: Collect Coverage for clang v14
env:
CLANG_VERSION: '14'
run: just test

- name: Install clang 15
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '15'

- name: Collect Coverage for clang v15
env:
CLANG_VERSION: '15'
run: just test

- name: Install clang 16
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '16'

- name: Collect Coverage for clang v16
env:
CLANG_VERSION: '16'
run: just test

- name: Install clang 17
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '17'

- name: Collect Coverage for clang v17
env:
CLANG_VERSION: '17'
run: just test

- name: Install clang 18
uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews
with:
version: '18'

- name: Collect Coverage for clang v18
env:
CLANG_VERSION: '18'
run: just test --run-ignored=all

- name: Generate Coverage HTML report
run: just pretty-cov

- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: HTML_report-${{ runner.os }}-clang_v${{ matrix.version }}
name: HTML_report-${{ runner.os }}
path: target/llvm-cov-pretty

- name: Generate Coverage lcov report
if: matrix.version == '16' && runner.os == 'Linux'
working-directory: cpp-linter-lib
env:
CLANG_VERSION: ${{ matrix.version }}
run: |
cargo llvm-cov report --lcov --output-path lcov.info
if: runner.os == 'Linux'
run: just lcov

- uses: codecov/codecov-action@v4
if: matrix.version == '16' && runner.os == 'Linux'
if: runner.os == 'Linux'
with:
token: ${{secrets.CODECOV_TOKEN}}
files: cpp-linter-lib/lcov.info
files: lcov.info
fail_ci_if_error: true # optional (default = false)
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
patch:
default:
informational: true
project:
default:
target: auto
# adjust accordingly based on how flaky your tests are
# this allows a 2% drop from the previous base commit coverage
threshold: 2%
2 changes: 1 addition & 1 deletion cpp-linter-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ log = "0.4.22"
openssl = { version = "0.10", features = ["vendored"], optional = true }
openssl-probe = { version = "0.1", optional = true }
regex = "1.10.6"
reqwest = { version = "0.12.7", features = ["json"]}
reqwest = "0.12.7"
semver = "1.0.23"
serde = { version = "1.0.209", features = ["derive"] }
serde-xml-rs = "0.6.0"
Expand Down
Loading