-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated scripts + pipline separation
- Loading branch information
1 parent
95645bb
commit c4f6b62
Showing
4 changed files
with
123 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Checks for merging PR, includes linting | ||
# Checks for merging PR, linting is currently disabled | ||
name: Integration pipeline | ||
run-name: Integration pipeline triggered by ${{ github.actor }} | ||
|
||
|
@@ -73,37 +73,6 @@ jobs: | |
- name: Show environment variables | ||
run: env | ||
|
||
# - name: C++ lint | ||
# uses: cpp-linter/cpp-linter-action@v2 | ||
# id: cpp_linter | ||
# with: | ||
# style: "file" | ||
# tidy-checks: "" | ||
# thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} | ||
|
||
# - name: Lint with pylint | ||
# run: | | ||
# pylint --disable=C0301 --disable=C0326 *.py | ||
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
|
||
# - name: Lint with flake8 | ||
# run: | | ||
# # stop the build if there are Python syntax errors or undefined names | ||
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
|
||
# - name: Check for linting errors | ||
# id: lint-check | ||
# run: | | ||
# if [ -f lint-results.txt ]; then | ||
# echo "Linting issues found" | ||
# cat lint-results.txt | ||
# exit 1 | ||
# else | ||
# echo "No linting issues found" | ||
# fi | ||
|
||
# - name: Compile | ||
# run: | | ||
# cd /ros_ws | ||
|
@@ -115,19 +84,6 @@ jobs: | |
# - name: Test run | ||
# run: | | ||
# ros2 run node_test jetson_node | ||
|
||
- name: Update pull request | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
if [[ $(git status --porcelain) ]]; then | ||
git add . | ||
git commit -m "Auto-fix lint issues" | ||
git push origin HEAD:${{ github.head_ref }} | ||
else | ||
echo "No lint fixes applied, nothing to commit." | ||
fi | ||
|
||
- run: echo ${{ github.event.inputs.delivery }} | ||
- run: echo ${{ inputs.delivery }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Lints the code of a branch | ||
name: Linting pipeline | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint-cpp: | ||
runs-on: self-hosted | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
id: cpp | ||
steps: | ||
- name: C++ lint | ||
uses: cpp-linter/cpp-linter-action@v2 | ||
with: | ||
style: "file" | ||
tidy-checks: "" | ||
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} | ||
|
||
lint-python: | ||
runs-on: self-hosted | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
id: python | ||
steps: | ||
- name: Lint with pylint | ||
run: | | ||
pylint --disable=C0301 --disable=C0326 *.py | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Check for linting errors | ||
id: lint-check | ||
run: | | ||
if [ -f lint-results.txt ]; then | ||
echo "Linting issues found" | ||
cat lint-results.txt | ||
exit 1 | ||
else | ||
echo "No linting issues found" | ||
fi | ||
update-pr: | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
if [[ $(git status --porcelain) ]]; then | ||
git add . | ||
git commit -m "Auto-fix lint issues" | ||
git push origin HEAD:${{ github.head_ref }} | ||
else | ||
echo "No lint fixes applied, nothing to commit." | ||
fi | ||
# bug checks | ||
# compilation | ||
# linting/formatting | ||
# Ament_flake8 | ||
# Ament_lint_cmake | ||
# Ament_xmllint | ||
# Black | ||
# Clang-tidy | ||
# Isort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Delete all logs for a given workflow | ||
# Usage: delete-logs.sh <repository> <workflow-name> | ||
|
||
set -oe pipefail | ||
|
||
REPOSITORY=$1 | ||
WORKFLOW_NAME=$2 | ||
|
||
# Validate arguments | ||
if [[ -z "$REPOSITORY" ]]; then | ||
echo "Repository is required" | ||
exit 1 | ||
fi | ||
|
||
if [[ -z "$WORKFLOW_NAME" ]]; then | ||
echo "Workflow name is required" | ||
exit 1 | ||
fi | ||
|
||
echo "Getting all completed runs for workflow $WORKFLOW_NAME in $REPOSITORY" | ||
|
||
RUNS=$( | ||
gh api \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"/repos/$REPOSITORY/actions/workflows/$WORKFLOW_NAME/runs" \ | ||
--paginate \ | ||
--jq '.workflow_runs[] | select(.conclusion != "") | .id' | ||
) | ||
|
||
echo "Found $(echo "$RUNS" | wc -l) completed runs for workflow $WORKFLOW_NAME" | ||
|
||
# Delete logs for each run | ||
for RUN in $RUNS; do | ||
echo "Deleting logs for run $RUN" | ||
gh api \ | ||
--silent \ | ||
--method DELETE \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"/repos/$REPOSITORY/actions/runs/$RUN/logs" || echo "Failed to delete logs for run $RUN" | ||
|
||
# Sleep for 100ms to avoid rate limiting | ||
sleep 0.1 | ||
done |