mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 14:42:40 +00:00
Add actionlint to our prek checks and fix issues (#8157)
This adds GitHub `actionlint` to validate our actions much more thoroughly ahead of time. This would have caught the recent issue of benchmarking workflow. To make this work, the PR adds a `run_actionlint.py` and extends our script utilities to support a release in an archive where we extract the binary. The `prek` check combines `actionlint` with `shellcheck-py` to also check the shell within the actions. It runs on all the workflows and action files. And we fix various existing issues: - Adds missing `description` metadata and missing `id: pages`. - Quotes shell variables across several files. - Document the intentional word-splitting in `clangd_tidy.yaml`. Assisted-by: Antigravity with Gemini
This commit is contained in:
1 parent
cc7e707321
commit
534197a3cd
12 files changed
+166
-24
No files matched your search
@@ -92,4 +92,6 @@ jobs:
|
||||
env:
|
||||
FILTER_FILES: ${{ steps.filter.outputs.has_cpp_files }}
|
||||
run: |
|
||||
# FILTER_FILES is a space-separated file list from paths-filter.
|
||||
# shellcheck disable=SC2086
|
||||
uvx --with clangd-tidy==1.1.0.post2 clangd-tidy -p . -j 10 $FILTER_FILES
|
||||
@@ -45,6 +45,7 @@ jobs:
|
||||
- name: Prebuild actions
|
||||
run: ./website/prebuild.py
|
||||
- name: Setup Pages
|
||||
id: pages
|
||||
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@b3aaceaef7e0ee231b499e7b5f49c03fc1d32199 # v1.338.0
|
||||
|
||||
@@ -82,9 +82,9 @@ jobs:
|
||||
env:
|
||||
REMOTE_CACHE_KEY: ${{ secrets.CARBON_BUILDS_GITHUB }}
|
||||
run: |
|
||||
echo "$REMOTE_CACHE_KEY" | base64 -d > $HOME/remote_cache_key.json
|
||||
echo "$REMOTE_CACHE_KEY" | base64 -d > "$HOME/remote_cache_key.json"
|
||||
echo "remote_cache_upload=--google_credentials=$HOME/remote_cache_key.json" \
|
||||
>> $GITHUB_ENV
|
||||
>> "$GITHUB_ENV"
|
||||
|
||||
- uses: ./.github/actions/build-setup-common
|
||||
with:
|
||||
@@ -93,14 +93,14 @@ jobs:
|
||||
|
||||
- name: Get nightly date
|
||||
run: |
|
||||
echo "nightly_date=$(date '+%Y.%m.%d')" >> $GITHUB_ENV
|
||||
echo "nightly_date=$(date '+%Y.%m.%d')" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build release
|
||||
run: |
|
||||
./scripts/run_bazel.py \
|
||||
--attempts=5 --jobs-on-last-attempt=4 \
|
||||
test -c opt --stamp --remote_download_toplevel \
|
||||
--pre_release=nightly --nightly_date=${nightly_date} \
|
||||
--pre_release=nightly --nightly_date="${nightly_date}" \
|
||||
//toolchain \
|
||||
//toolchain/install:carbon_toolchain_tar_gz \
|
||||
//toolchain/install:carbon_toolchain_tar_gz_test
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
VERSION=$( \
|
||||
./bazel-bin/toolchain/carbon version \
|
||||
| cut -d' ' -f5 | cut -d'+' -f1)
|
||||
echo "release_version=$VERSION" >> $GITHUB_ENV
|
||||
echo "release_version=$VERSION" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Create the release
|
||||
env:
|
||||
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p prek-output
|
||||
git diff > prek-output/diff
|
||||
cp $GITHUB_EVENT_PATH prek-output/event
|
||||
cp "$GITHUB_EVENT_PATH" prek-output/event
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: failure()
|
||||
with:
|
||||
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
./scripts/run_bazel.py \
|
||||
--attempts=5 --jobs-on-last-attempt=4 \
|
||||
test ${{ matrix.config.flags }} \
|
||||
--target_pattern_file=$TARGETS_FILE
|
||||
--target_pattern_file="$TARGETS_FILE"
|
||||
|
||||
# See "Disk space before build" in `test-setup`.
|
||||
- name: Disk space after build
|
||||
|
||||
Reference in new issue
Block a user