docs: add jetson setup #69
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
# yamllint disable rule:line-length | |
--- | |
name: Bazel Buildifier | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: ['*'] | |
jobs: | |
bazel_buildifier: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache bazel | |
uses: actions/cache@v2 | |
env: | |
cache-name: bazel-cache | |
with: | |
path: | | |
~/.cache/bazelisk | |
~/.cache/bazel | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.ref }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}-development | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Get changed files | |
uses: jitterbit/get-changed-files@v1 | |
id: changed_files | |
with: | |
format: space-delimited | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run Buildifier | |
run: |- | |
IFS=' ' read -r -a files <<< "${{ steps.changed_files.outputs.all }}" | |
bazel_files=() | |
for file in "${files[@]}"; do | |
if [[ "$file" == *BUILD || "$file" == *WORKSPACE || "$file" == *MODULE.bazel || "$file" == *.bazelrc ]]; then | |
bazel_files+=("$file") | |
fi | |
done | |
if [ ${#bazel_files[@]} -gt 0 ]; then | |
echo "Running bazel buildifier" | |
bazel run //bazel:buildifier_check | |
else | |
echo -e "Skipping bazel buildifier since no bazel files were changed." | |
fi | |
- name: Fail message | |
if: failure() | |
run: |- | |
echo -e "For applying automatic fixes run: | |
bazel run //bazel:buildifier" |