Tweak github actions C++ linter (#11105)

This commit is contained in:
Jarred Sumner
2024-05-15 21:28:43 -07:00
committed by GitHub
parent d90058a522
commit e5e5f98592
3 changed files with 40 additions and 11 deletions

View File

@@ -42,13 +42,6 @@ jobs:
name: Lint
uses: ./.github/workflows/run-lint.yml
secrets: inherit
lint-cpp:
if: ${{ !inputs.run-id }}
name: Lint C++
uses: ./.github/workflows/run-lint-cpp.yml
secrets: inherit
with:
pr-number: ${{ github.event.number }}
linux-x64:
if: ${{ !inputs.run-id }}
name: Build linux-x64

36
.github/workflows/lint-cpp.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: lint-cpp
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
run-id:
type: string
description: The workflow ID to download artifacts (skips the build step)
pull_request:
paths-ignore:
- .vscode/**/*
- docs/**/*
- examples/**/*
push:
branches:
- main
paths-ignore:
- .vscode/**/*
- docs/**/*
- examples/**/*
jobs:
lint-cpp:
if: ${{ !inputs.run-id }}
name: Lint C++
uses: ./.github/workflows/run-lint-cpp.yml
secrets: inherit
with:
pr-number: ${{ github.event.number }}

View File

@@ -2,7 +2,6 @@ name: lint-cpp
permissions:
contents: read
actions: write
env:
LLVM_VERSION: 16
@@ -51,16 +50,17 @@ jobs:
CPU_TARGET: native
run: |
rm -f did_fail format.log
bun build:tidy &2>1 | tee format.log && echo 0 > did_succeed.txt
echo "${{ inputs.pr-number }}" > pr-number.txt
echo "pr_number=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
bun run build:tidy &> >(tee -p format.log) && echo 0 > did_succeed.txt
# Upload format.log as github artifact for the workflow
echo "text_output=$(cat format.log || echo 0)" >> $GITHUB_OUTPUT
if [ -f did_succeed.txt ]; then
echo "0" > did_fail.txt
else
echo "1" > did_fail.txt
fi
echo "did_fail=$(cat did_fail.txt)" >> $GITHUB_OUTPUT
echo "${{ inputs.pr-number }}" > pr-number.txt
- name: Upload format.log
uses: actions/upload-artifact@v2
with: