diff --git a/.github/workflows/check_pr_description.yml b/.github/workflows/check_pr_description.yml index cfa5207..7a4552b 100644 --- a/.github/workflows/check_pr_description.yml +++ b/.github/workflows/check_pr_description.yml @@ -4,12 +4,15 @@ name: PR description on: # yamllint disable-line rule:truthy pull_request: types: [opened, edited, synchronize] + jobs: check-description: runs-on: ubuntu-latest + steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Check PR description for issue link id: contains_issue run: | @@ -25,6 +28,7 @@ jobs: else echo "PR description contains a valid issue link." fi + - name: Fail PR if no issue link found if: failure() run: |- diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index ff070ac..2be5ce4 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -4,6 +4,7 @@ name: Clang-Format on: # yamllint disable-line rule:truthy pull_request: branches: ['*'] + jobs: clang-format: runs-on: ubuntu-latest diff --git a/.github/workflows/gitlint.yml b/.github/workflows/gitlint.yml index 691038e..e9efcd9 100644 --- a/.github/workflows/gitlint.yml +++ b/.github/workflows/gitlint.yml @@ -3,6 +3,7 @@ name: GitLint on: # yamllint disable-line rule:truthy pull_request: branches: ['*'] + jobs: gitlint: runs-on: ubuntu-latest diff --git a/.github/workflows/llvm_cov.yml b/.github/workflows/llvm_cov.yml index ebbf052..7334d6d 100644 --- a/.github/workflows/llvm_cov.yml +++ b/.github/workflows/llvm_cov.yml @@ -7,14 +7,12 @@ on: # yamllint disable-line rule:truthy jobs: coverage: runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v3 + container: + image: dtors/base-cpp:latest - - name: Install LLVM - run: | - sudo apt update - sudo apt install -y llvm + steps: + - name: Checkout code + uses: actions/checkout@v4 - name: Run Coverage Script - run: bazel run //tools/coverage:llvm_cov -- -t //examples/cpp:test -s + run: bazelisk run //tools/coverage:llvm_cov -- -t //examples/cpp:test -s diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index d149005..699fbc7 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -8,9 +8,16 @@ on: # yamllint disable-line rule:truthy jobs: yamllint: runs-on: ubuntu-latest + container: + image: dtors/base-cpp:latest + steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Configure Git Safe Directory + run: | + git config --global --add safe.directory $(pwd) - name: Find affected files run: | @@ -20,7 +27,6 @@ jobs: cat affected_files.txt - name: Find affected yaml files - id: bazel_targets run: | > affected_yaml_files.txt @@ -33,14 +39,8 @@ jobs: sort -u affected_yaml_files.txt -o affected_yaml_files.txt echo "Affected yaml files:" cat affected_yaml_files.txt - echo "yaml_files=$(cat affected_yaml_files.txt | tr '\n' ' ')" >> $GITHUB_ENV - - - name: Install yamllint - if: env.yaml_files != '' - run: | - python -m pip install --upgrade pip - pip install yamllint + shell: bash - name: Lint YAML files if: env.yaml_files != '' diff --git a/Dockerfile b/Dockerfile index 2226ff4..95ed7de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,6 +62,8 @@ RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/cl RUN update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-18 100 +RUN update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-18 100 + RUN echo "alias bazel='bazelisk'" >> $HOME/.bashrc RUN echo 'if [ -d "$HOME/bin" ] ; then\n PATH="$HOME/bin:$PATH"\nfi' >> $HOME/.bashrc && \ diff --git a/tools/coverage/llvm_cov.sh b/tools/coverage/llvm_cov.sh index 8f34ccb..ce1ddb2 100755 --- a/tools/coverage/llvm_cov.sh +++ b/tools/coverage/llvm_cov.sh @@ -31,7 +31,7 @@ if [[ -z "${BAZEL_TESTS}" ]]; then fi OUTPUT_DIR="${OUTPUT_DIR:-"$(mktemp -d)/cov_report"}" -BAZEL_OUTPUT=${BAZEL_OUTPUT:-"/home/${USER}/.cache/coverage"} +BAZEL_OUTPUT=${BAZEL_OUTPUT:-"${HOME}/.cache/coverage"} SKIP_HTML_REPORT=${SKIP_HTML_REPORT:-false} echo "INFO: Bazel cache: ${BAZEL_OUTPUT}" echo "INFO: Tests target: ${BAZEL_TESTS}"