Add text groups (#721)
This commit is contained in:
+16
@@ -112,6 +112,8 @@ runs:
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
run: |
|
||||
echo "::group::Install Dependencies"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
# Install from git branch if testing in ultralytics/actions repo, otherwise from PyPI
|
||||
if [ "$GITHUB_REPOSITORY" = "ultralytics/actions" ]; then
|
||||
echo "Installing from git branch: $GITHUB_REF"
|
||||
@@ -168,6 +170,8 @@ runs:
|
||||
- name: Run Python
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.python == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize')
|
||||
run: |
|
||||
echo "::group::Run Python"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
ruff check \
|
||||
--fix \
|
||||
--unsafe-fixes \
|
||||
@@ -188,6 +192,8 @@ runs:
|
||||
- name: Run Biome
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.biome == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize')
|
||||
run: |
|
||||
echo "::group::Run Biome"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
if [ -f "biome.json" ] || [ -f "biome.jsonc" ]; then
|
||||
npm install -g @biomejs/biome@latest
|
||||
npx biome --version
|
||||
@@ -202,6 +208,8 @@ runs:
|
||||
- name: Run Prettier
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && (inputs.prettier == 'true' || inputs.markdown == 'true') && (github.event.action == 'opened' || github.event.action == 'synchronize')
|
||||
run: |
|
||||
echo "::group::Run Prettier"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
npm install -g [email protected] prettier-plugin-sh
|
||||
ultralytics-actions-update-markdown-code-blocks
|
||||
npx prettier --write --list-different --print-width 120 "**/*.{js,jsx,ts,tsx,css,less,scss,json,yml,yaml,html,vue,svelte}" '!**/*lock.{json,yaml,yml}' '!**/*.lock' '!**/model.json' '!**/*.min.js' '!**/*.min.css'
|
||||
@@ -221,6 +229,8 @@ runs:
|
||||
- name: Run Swift Formatter
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.swift == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize')
|
||||
run: |
|
||||
echo "::group::Run Swift Formatter"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
brew install swift-format
|
||||
swift-format --in-place --recursive .
|
||||
shell: bash
|
||||
@@ -245,6 +255,8 @@ runs:
|
||||
- name: Run Codespell
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.spelling == 'true' && (github.event.action == 'opened' || github.event.action == 'synchronize')
|
||||
run: |
|
||||
echo "::group::Run Codespell"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
codespell \
|
||||
--builtin clear,rare,informal,en-GB_to_en-US \
|
||||
--write-changes \
|
||||
@@ -305,6 +317,8 @@ runs:
|
||||
- name: Bun Update
|
||||
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && inputs.bun_update == 'true' && github.event.action == 'opened'
|
||||
run: |
|
||||
echo "::group::Bun Update"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
if [ -f "bun.lock" ] || [ -f "bun.lockb" ]; then
|
||||
npm install -g bun
|
||||
bun update
|
||||
@@ -321,6 +335,8 @@ runs:
|
||||
GITHUB_USERNAME: ${{ inputs.github_username }}
|
||||
GITHUB_EMAIL: ${{ inputs.github_email }}
|
||||
run: |
|
||||
echo "::group::Commit and Push Changes"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
COMMIT_MSG="Auto-format by https://ultralytics.com/actions"
|
||||
# Check if last two commits were both auto-format to prevent recursive loops
|
||||
LAST_TWO=$(git log -2 --pretty=format:'%s' 2>/dev/null || echo "")
|
||||
|
||||
@@ -9,17 +9,20 @@ runs:
|
||||
- name: Cleanup disk space
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Free space before deletion:"
|
||||
echo "::group::Disk Space Before Cleanup"
|
||||
df -h /
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Remove Tool Cache and Swap"
|
||||
# Remove tool cache to free up ~15GB of space per https://github.com/ultralytics/ultralytics/pull/15848
|
||||
rm -rf /opt/hostedtoolcache || true
|
||||
|
||||
# Remove swap space to free up ~4GB
|
||||
if [ -f /swapfile ]; then
|
||||
sudo swapoff -a
|
||||
sudo rm -f /swapfile
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "Free space after deletion:"
|
||||
echo "::group::Disk Space After Cleanup"
|
||||
df -h /
|
||||
echo "::endgroup::"
|
||||
|
||||
+6
-1
@@ -32,6 +32,8 @@ runs:
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
echo "::group::Install ultralytics-actions"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
# Install from git commit if testing in ultralytics/actions repo, otherwise from main
|
||||
if [ "$GITHUB_REPOSITORY" = "ultralytics/actions" ]; then
|
||||
echo "Installing from commit: $GITHUB_SHA"
|
||||
@@ -52,5 +54,8 @@ runs:
|
||||
ORG: ${{ inputs.org }}
|
||||
VISIBILITY: ${{ inputs.visibility }}
|
||||
REPO_VISIBILITY: ${{ github.event.repository.visibility }}
|
||||
run: python -m actions.scan_prs
|
||||
run: |
|
||||
echo "::group::Scan PRs"
|
||||
trap 'echo "::endgroup::"' EXIT
|
||||
python -m actions.scan_prs
|
||||
shell: bash
|
||||
|
||||
Reference in New Issue
Block a user