Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync files #2146

Merged
merged 1 commit into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:

- name: Get modified files
id: get-modified-files
uses: tj-actions/changed-files@v32
uses: tj-actions/changed-files@v34
with:
files: |
**/*.cpp
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/clang-tidy-pr-comments-manually.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: clang-tidy-pr-comments-manually

on:
workflow_dispatch:
inputs:
workflow_run_id_or_url:
description: The target workflow run ID or URL of the build-and-test-differential workflow
required: true
jobs:
clang-tidy-pr-comments-manually:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Download analysis results
run: |
workflow_run_id=$(echo "${{ inputs.workflow_run_id_or_url }}" | sed -e "s|.*runs/||" -e "s|/jobs.*||")
gh run download "$workflow_run_id" -D /tmp || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if the fixes.yaml file exists
id: check-fixes-yaml-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@v1
with:
files: /tmp/clang-tidy-result/fixes.yaml

- name: Set variables
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
id: set-variables
run: |
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"

- name: Check out PR head
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
uses: actions/checkout@v3
with:
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
persist-credentials: false

- name: Replace paths in fixes.yaml
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
run: |
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
cat /tmp/clang-tidy-result/fixes.yaml

- name: Copy fixes.yaml to access from Docker Container Action
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
run: |
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml

- name: Run clang-tidy-pr-comments action
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
uses: platisd/clang-tidy-pr-comments@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: fixes.yaml
pull_request_id: ${{ steps.set-variables.outputs.pr-id }}
15 changes: 13 additions & 2 deletions .github/workflows/clang-tidy-pr-comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,53 @@ on:

jobs:
clang-tidy-pr-comments:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Download analysis results
run: |
gh run download ${{ github.event.workflow_run.id }} -D /tmp
gh run download ${{ github.event.workflow_run.id }} -D /tmp || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if the fixes.yaml file exists
id: check-fixes-yaml-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@v1
with:
files: /tmp/clang-tidy-result/fixes.yaml

- name: Set variables
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
id: set-variables
run: |
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"

- name: Check out PR head
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
uses: actions/checkout@v3
with:
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
persist-credentials: false

- name: Replace paths in fixes.yaml
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
run: |
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
cat /tmp/clang-tidy-result/fixes.yaml

- name: Copy fixes.yaml to access from Docker Container Action
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
run: |
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml

- name: Run clang-tidy-pr-comments action
if: ${{ steps.check-fixes-yaml-existence.outputs.exists == 'true' }}
uses: platisd/clang-tidy-pr-comments@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .markdown-link-check.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{
"pattern": "^http://localhost"
},
{
"pattern": "^http://127\\.0\\.0\\.1"
},
{
"pattern": "^https://github.com/.*/discussions/new"
}
Expand Down