Skip to content

Commit

Permalink
[ci] Add actionlint job (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava authored Jul 13, 2024
1 parent f275152 commit a061629
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
self-hosted-runner:
labels:
- ubuntu-20.04-32
11 changes: 7 additions & 4 deletions .github/workflows/hypersdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
- name: Run shellcheck
shell: bash
run: scripts/tests.shellcheck.sh
- name: Run actionlint
shell: bash
run: scripts/tests.actionlint.sh

hypersdk-unit-tests:
runs-on: ubuntu-20.04-32
Expand Down Expand Up @@ -87,14 +90,14 @@ jobs:
id: check_changes
run: |
diff=$(git diff --name-only HEAD origin/main)
echo "diff:\n$diff\n"
output=$(echo $diff | grep -v '^x/programs/' || true)
printf "diff:\n%s\n" "$diff"
output=$(echo "$diff" | grep -v '^x/programs/' || true)
if [ -n "$diff" ] && [ -z "$output" ]; then
echo "only x/programs changed, will skip unafected tests"
echo "only_programs_changed=true" >> $GITHUB_OUTPUT
echo "only_programs_changed=true" >> "$GITHUB_OUTPUT"
else
echo "cannot skip tests"
echo "only_programs_changed=false" >> $GITHUB_OUTPUT
echo "only_programs_changed=false" >> "$GITHUB_OUTPUT"
fi
# TokenVM
Expand Down
7 changes: 7 additions & 0 deletions scripts/tests.actionlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -euo pipefail

go install github.com/rhysd/actionlint/cmd/[email protected]

actionlint

0 comments on commit a061629

Please sign in to comment.