Skip to content

allow version to be a path #301

allow version to be a path

allow version to be a path #301

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths:
- "**.py"
- "**requirements*.txt"
- pyproject.toml
- .pre-commit-config.yaml
- ".github/workflows/python-test.yml"
- "!docs/**"
workflow_dispatch:
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install . -r requirements-dev.txt
- name: Collect Coverage
run: coverage run -m pytest -vv
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ runner.os }}
path: .coverage*
coverage-report:
needs: [test]
uses: cpp-linter/.github/.github/workflows/py-coverage.yml@main
secrets: inherit
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheel
run: python -m pip wheel -w dist .
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: clang-tools-pip_wheel
path: dist/*.whl
install:
needs: [build]
strategy:
matrix:
version: [ 7, 8, 9, 10, 11, 12, 12.0.1, 13, 14, 15, 16, 17, 18 ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: clang-tools-pip_wheel
path: dist/
- name: Install pkg from wheel
# using a wildcard as filename on Windows requires a bash shell
shell: bash
run: pip install dist/*.whl
- name: Install clang-tools binaries
run: clang-tools --install ${{ matrix.version }} --tool clang-format clang-tidy clang-query clang-apply-replacements
- name: Show path of binaries
shell: bash
run: |
if [ "${{ matrix.version }}" = "15" -o "${{ matrix.version }}" = "16" ] && [ "${{ matrix.os }}" = "windows-latest" ]; then
which clang-format
which clang-tidy
which clang-query
which clang-apply-replacements
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
which "clang-format-${{ matrix.version }}"
which "clang-tidy-${{ matrix.version }}"
which "clang-query-${{ matrix.version }}"
which "clang-apply-replacements-${{ matrix.version }}"
fi
- name: Check clang-tools on Windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
case "${{ matrix.version }}" in
15|16)
clang-format.exe --version
clang-tidy.exe --version
clang-query.exe --version
clang-apply-replacements.exe --version
;;
*)
clang-format-${{ matrix.version }}.exe --version
clang-tidy-${{ matrix.version }}.exe --version
clang-query-${{ matrix.version }}.exe --version
clang-apply-replacements-${{ matrix.version }}.exe --version
;;
esac
- name: Check clang-tools on Unix
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
if [ "${{ matrix.version }}" = "12.0.1" -a "${{ matrix.os }}" = "ubuntu-latest" ]; then
clang-format-12.0.1 --version
clang-tidy-12.0.1 --version
clang-query-12.0.1 --version
clang-apply-replacements-12.0.1 --version
else
clang-format-${{ matrix.version }} --version
clang-tidy-${{ matrix.version }} --version
clang-query-${{ matrix.version }} --version
clang-apply-replacements-${{ matrix.version }} --version
fi
docs:
uses: cpp-linter/.github/.github/workflows/sphinx.yml@main
with:
path-to-doc: docs/_build/html