Skip to content

Commit

Permalink
Fix action lints (netdata#17120)
Browse files Browse the repository at this point in the history
* Clang output should be disabled

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Commend out Clang

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Fix quoting and snooze sc2043

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Fix failure messages garbages/steps

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Fix failure messages step, cleanup garbages

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Add quoting whever is necessary and group the echo commands

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* Fix parorama

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* apply code review

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* micnor fix

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

* more fixes

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>

---------

Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
  • Loading branch information
tkatsoulas authored Mar 29, 2024
1 parent 1cc14e2 commit 90b2860
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 57 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,9 @@ jobs:
SLACK_USERNAME: 'GitHub Actions'
SLACK_MESSAGE: |-
${{ github.repository }}: Failed to prepare release artifacts for upload.
CHeckout: ${{ steps.checkout.outcome }}
Checkout: ${{ steps.checkout.outcome }}
Prepare environment: ${{ steps.prepare.outcome }}
Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
Fetch static builds: ${{ steps.fetch-static.outcome }}
Consolidate artifacts: ${{ steps.consolidate.outcome }}
Store: ${{ steps.store.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/cloud_regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,24 @@ jobs:
PR_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
id: output-workflow-dispatch-params
run: |
if [ ${{ github.event_name }} == 'pull_request_target' ]; then
if [ "${{ github.event_name }}" == 'pull_request_target' ]; then
NETDATA_CUSTOM_REPO="$PR_REPO_NAME"
NETDATA_CUSTOM_BRANCH="$PR_BRANCH_NAME"
NETDATA_CUSTOM_PR_NUMBER="${{ github.event.number }}"
NETDATA_CUSTOM_COMMIT_HASH="$PR_COMMIT_HASH"
elif [ ${{ github.event_name }} == 'push' ]; then
elif [ "${{ github.event_name }}" == 'push' ]; then
NETDATA_CUSTOM_REPO="netdata/netdata"
NETDATA_CUSTOM_BRANCH="master"
NETDATA_CUSTOM_PR_NUMBER=""
NETDATA_CUSTOM_COMMIT_HASH="${{ github.sha }}"
fi
echo "netdata_repo=${NETDATA_CUSTOM_REPO}" >> $GITHUB_OUTPUT
echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}" >> $GITHUB_OUTPUT
echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}" >> $GITHUB_OUTPUT
echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}" >> $GITHUB_OUTPUT
{
echo "netdata_repo=${NETDATA_CUSTOM_REPO}"
echo "netdata_branch=${NETDATA_CUSTOM_BRANCH}"
echo "netdata_pr_number=${NETDATA_CUSTOM_PR_NUMBER}"
echo "netdata_commit_hash=${NETDATA_CUSTOM_COMMIT_HASH}"
} >> "$GITHUB_OUTPUT"
- name: Trigger Full Cloud Regression
uses: aurelien-baudet/workflow-dispatch@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ jobs:
- name: Create and Push Manifest
id: manifest
if: github.repository == 'netdata/netdata'
run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests '' ${{ needs.gen-tags.outputs.tags }})
run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests '' "${{ needs.gen-tags.outputs.tags }}")"
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand Down Expand Up @@ -489,7 +489,7 @@ jobs:
- name: Create and Push Manifest
id: manifest
if: github.repository == 'netdata/netdata'
run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'quay.io' ${{ needs.gen-tags.outputs.tags }})
run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'quay.io' "${{ needs.gen-tags.outputs.tags }}")"
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand Down Expand Up @@ -645,7 +645,7 @@ jobs:
- name: Create and Push Manifest
id: manifest
if: github.repository == 'netdata/netdata'
run: docker buildx imagetools create $(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'ghcr.io' ${{ needs.gen-tags.outputs.tags }})
run: docker buildx imagetools create "$(.github/scripts/gen-docker-imagetool-args.py /tmp/digests 'ghcr.io' "${{ needs.gen-tags.outputs.tags }}")"
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/generate-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ jobs:
SLACK_MESSAGE: |-
${{ github.repository }}: Failed to create PR rebuilding integrations.js
Checkout Agent: ${{ steps.checkout-agent.outcome }}
Get Go Ref: ${{ steps.get-go-ref.outcome }}
Checkout Go: ${{ steps.checkout-go.outcome }}
Prepare Dependencies: ${{ steps.prep-deps.outcome }}
Prep python env and deps: ${{ steps.prep-deps.outcome }}
Generate Integrations: ${{ steps.generate.outcome }}
Generate Integrations Documentation: ${{ steps.generate-integrations-documentation.outcome }}
Generate src/collectors/COLLECTORS.md: ${{ steps.generate-collectors-md.outcome }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/monitor-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "RELEASE_CHANNEL=${{ github.event.inputs.channel }}" >> "${GITHUB_ENV}"
else:
else
echo "RELEASE_CHANNEL=stable" >> "${GITHUB_ENV}"
fi
- name: Init Python environment
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/repoconfig-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ jobs:
id: package-upload
if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
run: |
for arch in ${{ matrix.arches }}; do
for suffix in '' -edge -repoconfig ; do
# shellcheck disable=SC2043
for arch in "${{ matrix.arches }}"; do
for suffix in '' -edge -repoconfig; do
.github/scripts/package-upload.sh \
${{ matrix.pkgclouddistro }} \
${arch} \
${{ matrix.format }} \
netdata/netdata${suffix}
"${{ matrix.pkgclouddistro }}" \
"${arch}" \
"${{ matrix.format }}" \
netdata/netdata"${suffix}"
done
done
- name: Failure Notification
Expand Down
72 changes: 36 additions & 36 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
actionlint: ${{ steps.actionlint.outputs.run }}
clangformat: ${{ steps.clangformat.outputs.run }}
# clangformat: ${{ steps.clangformat.outputs.run }}
flake8: ${{ steps.flake8.outputs.run }}
golangci-lint: ${{ steps.golangci-lint.outputs.run }}
hadolint: ${{ steps.hadolint.outputs.run }}
Expand Down Expand Up @@ -65,11 +65,11 @@ jobs:
run: |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/golangci-lint') }}" = "true" ]; then
echo "run=true" >> "${GITHUB_OUTPUT}"
elif git diff --name-only origin/${{ github.base_ref }} HEAD -- | grep -Eq '.*\.go' ; then
echo "run=true" >> $GITHUB_OUTPUT
elif git diff --name-only origin/"${{ github.base_ref }}" HEAD -- | grep -Eq '.*\.go'; then
echo "run=true" >> "${GITHUB_OUTPUT}"
echo 'Go code has changed, need to run golangci-lint.'
else
echo "run=false" >> $GITHUB_OUTPUT
echo "run=false" >> "${GITHUB_OUTPUT}"
fi
- name: Check files for hadolint
id: hadolint
Expand Down Expand Up @@ -122,38 +122,38 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check

clang-format:
name: clang-format
needs: prep-review
if: needs.prep-review.outputs.clangformat == 'true'
runs-on: ubuntu-latest
steps:
- name: Git clone repository
uses: actions/checkout@v4
with:
submodules: false
fetch-depth: 0
- name: Check for label
id: label
run: |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
echo 'check-all=true' >> "${GITHUB_OUTPUT}"
else
echo 'check-all=false' >> "${GITHUB_OUTPUT}"
fi
- name: Run clang-format
run: |
if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
else
git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
xargs -n 1 -r clang-format -i --style=file
fi
git status --porcelain=v1 > /tmp/porcelain
if [ -s /tmp/porcelain ]; then
cat /tmp/porcelain
exit 1
fi
# clang-format:
# name: clang-format
# needs: prep-review
# if: needs.prep-review.outputs.clangformat == 'true'
# runs-on: ubuntu-latest
# steps:
# - name: Git clone repository
# uses: actions/checkout@v4
# with:
# submodules: false
# fetch-depth: 0
# - name: Check for label
# id: label
# run: |
# if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
# echo 'check-all=true' >> "${GITHUB_OUTPUT}"
# else
# echo 'check-all=false' >> "${GITHUB_OUTPUT}"
# fi
# - name: Run clang-format
# run: |
# if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
# find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
# else
# git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
# xargs -n 1 -r clang-format -i --style=file
# fi
# git status --porcelain=v1 > /tmp/porcelain
# if [ -s /tmp/porcelain ]; then
# cat /tmp/porcelain
# exit 1
# fi

flake8:
name: flake8
Expand Down

0 comments on commit 90b2860

Please sign in to comment.