Skip to content

Work/1169 entity exists conveniences #178

Work/1169 entity exists conveniences

Work/1169 entity exists conveniences #178

Workflow file for this run

name: Code quality
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pylint:
runs-on: ${{ matrix.config.os }}
name: Pylint
strategy:
matrix:
config:
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/bootstrap_platform
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r resources/build/linter-requirements.txt
python -m pip install -r src/openassetio-python/tests/requirements.txt
- name: Build
run: |
python -m pip install src/openassetio-python
env:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/.conan/conan_paths.cmake
- name: Lint
uses: TheFoundryVisionmongers/fn-pylint-action@v2
with:
pylint-args: >
--recursive=y --disable=fixme
--rcfile=src/openassetio-python/pyproject.toml
src/openassetio-python/package/openassetio
src/openassetio-python/tests
black:
runs-on: ubuntu-latest
name: Python formatting
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r resources/build/linter-requirements.txt
- name: Check Python formatting
run: black --config src/openassetio-python/pyproject.toml --check --diff .
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# Note: in order to keep an `actions/cache` cache up to date, we must
# use the approach detailed in
# https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache
# i.e. load the most recently created cache that matches a prefix,
# then create an entirely new cache with every run.
cpp-linters:
name: C++ linters
runs-on: ubuntu-20.04
strategy:
matrix:
config:
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/bootstrap_platform
- name: Cache ccache cache
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ubuntu-20.04-ccache-lint-${{ github.run_id }}
restore-keys: ubuntu-20.04-ccache-lint-
- name: Install dependencies
# Configure the system and install library dependencies via
# conan packages.
run: |
python -m pip install -r resources/build/linter-requirements.txt
clang-tidy --version
clang-format --version
cpplint --version
- name: Configure CMake build
run: >
cmake -S . -B build -G Ninja
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/ccache
-DCMAKE_C_COMPILER_LAUNCHER=/usr/bin/ccache
--install-prefix ${{ github.workspace }}/dist
--toolchain ${{ github.workspace }}/.conan/conan_paths.cmake
--preset lint
- name: Build and lint
run: |
/usr/bin/ccache -s
cmake --build build
/usr/bin/ccache -s
env:
CCACHE_DIR: /tmp/ccache
sanitizers:
name: Sanitizers
runs-on: ubuntu-20.04
strategy:
matrix:
config:
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/bootstrap_platform
- name: Cache ccache cache
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ubuntu-20.04-ccache-sanitize-${{ github.run_id }}
restore-keys: ubuntu-20.04-ccache-sanitize-
- name: Configure CMake build
run: >
cmake -S . -B build -G Ninja
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/bin/ccache
-DCMAKE_C_COMPILER_LAUNCHER=/usr/bin/ccache
--install-prefix ${{ github.workspace }}/dist
--toolchain ${{ github.workspace }}/.conan/conan_paths.cmake
--preset sanitize
- name: Build and test
run: |
/usr/bin/ccache -s
ctest -VV --test-dir build --parallel 4
/usr/bin/ccache -s
env:
CCACHE_DIR: /tmp/ccache