mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Tweak github actions C++ linter (#11105)
This commit is contained in:
7
.github/workflows/ci.yml
vendored
7
.github/workflows/ci.yml
vendored
@@ -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
36
.github/workflows/lint-cpp.yml
vendored
Normal 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 }}
|
||||
8
.github/workflows/run-lint-cpp.yml
vendored
8
.github/workflows/run-lint-cpp.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user