Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 2 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,33 +221,7 @@ jobs:
use_container: false
runs_on: '["self-hosted","linux","qcs"]'
self_hosted_owner: rcore-os
command: |
set -eux
git_cmd() {
git -c safe.directory="${GITHUB_WORKSPACE}" "$@"
}
ensure_since_ref() {
ref="$1"
git_cmd cat-file -e "${ref}^{commit}" 2>/dev/null && return 0
git_cmd fetch --no-tags --depth=1 origin "${ref}" || true
git_cmd cat-file -e "${ref}^{commit}" 2>/dev/null
}

if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
cargo xtask sync-lint --since "${{ github.event.pull_request.base.sha }}"
elif [ "${GITHUB_EVENT_NAME}" = "push" ]; then
before="${{ github.event.before }}"
if [ "${before}" = "0000000000000000000000000000000000000000" ]; then
cargo xtask sync-lint
elif ensure_since_ref "${before}"; then
cargo xtask sync-lint --since "${before}"
else
echo "::notice::before commit ${before} is unavailable; running full sync-lint"
cargo xtask sync-lint
fi
else
cargo xtask sync-lint
fi
command: cargo xtask sync-lint --since "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}"
cache_key: ""
container_image: base
fetch_depth: full
Expand Down Expand Up @@ -304,33 +278,7 @@ jobs:
use_container: false
runs_on: '["self-hosted","linux","qcs"]'
self_hosted_owner: rcore-os
command: |
set -eux
git_cmd() {
git -c safe.directory="${GITHUB_WORKSPACE}" "$@"
}
ensure_since_ref() {
ref="$1"
git_cmd cat-file -e "${ref}^{commit}" 2>/dev/null && return 0
git_cmd fetch --no-tags --depth=1 origin "${ref}" || true
git_cmd cat-file -e "${ref}^{commit}" 2>/dev/null
}

if [ "${GITHUB_EVENT_NAME}" = "pull_request" ]; then
cargo xtask clippy --since "${{ github.event.pull_request.base.sha }}"
elif [ "${GITHUB_EVENT_NAME}" = "push" ]; then
before="${{ github.event.before }}"
if [ "${before}" = "0000000000000000000000000000000000000000" ]; then
cargo xtask clippy
elif ensure_since_ref "${before}"; then
cargo xtask clippy --since "${before}"
else
echo "::notice::before commit ${before} is unavailable; running full clippy"
cargo xtask clippy
fi
else
cargo xtask clippy
fi
command: cargo xtask clippy --since "${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}"
cache_key: ""
container_image: base
fetch_depth: full
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/starry-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,33 @@ concurrency:
cancel-in-progress: false

jobs:
scheduled_clippy_all:
name: Scheduled clippy all
runs-on: ubuntu-latest
container:
image: ghcr.io/rcore-os/tgoskits-container:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: starry-apps-clippy-all
save-if: ${{ github.event_name == 'schedule' }}

- name: Show Rust version
run: rustc --version

- name: Run clippy all
shell: bash
run: |
set -euxo pipefail
cargo xtask clippy --all

starry_apps:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
Expand Down
7 changes: 3 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cargo xtask starry qemu --arch aarch64
cargo xtask axvisor qemu --arch aarch64

# Linting
cargo xtask clippy # against scripts/test/clippy_crates.csv whitelist
cargo xtask clippy # all workspace crates, no-deps by default; prints timing
cargo xtask clippy --package <crate> # specific crate
cargo xtask clippy --since <git-ref> # only changed crates
cargo xtask clippy --all # all workspace crates
Expand Down Expand Up @@ -90,18 +90,17 @@ Board-level platform crates: `axplat-dyn` (dynamic dispatch), `somehal`, `riscv6
## CI

- **fmt**: `cargo fmt --all -- --check`
- **clippy**: `cargo xtask clippy --since <base>` (incremental for PRs)
- **clippy**: `cargo xtask clippy --since <base>` (incremental for PRs; prints start, finish, and elapsed time)
- **sync-lint**: `cargo xtask sync-lint --since <base>`
- **std tests**: `cargo xtask test`
- **QEMU tests**: ArceOS/StarryOS/Axvisor across all 4 architectures
- **Board tests**: self-hosted runners for OrangePi-5-Plus, RDK-S100
- Crate lists: `scripts/test/clippy_crates.csv`, `scripts/test/std_crates.csv`
- Std test crate list: `scripts/test/std_crates.csv`

## Conventions

- PR titles: Conventional Commits `type(scope): content`, e.g. `feat(axbuild): add board test flow`, `fix(starry-process): correct tty cleanup`
- PR titles in English, bodies in Chinese
- Do not silence clippy warnings with `allow`; fix the root cause
- After modifying a crate, if it passes clippy but is missing from `scripts/test/clippy_crates.csv`, add it
- Do not add agent/AI branding or signatures to commits/PRs
- Read and strictly follow all conventions in AGENTS.md
11 changes: 5 additions & 6 deletions apps/starry/mosquitto/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

app_dir="${STARRY_APP_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
base_rootfs="${STARRY_BASE_ROOTFS:-}"
base_rootfs="${STARRY_ROOTFS:-${STARRY_BASE_ROOTFS:-}}"
staging_root="${STARRY_STAGING_ROOT:-}"
overlay_dir="${STARRY_OVERLAY_DIR:-}"
apk_cache="${STARRY_WORKSPACE:-$(cd "$app_dir/../../.." && pwd)}/target/mosquitto-apk-cache"
Expand All @@ -28,14 +28,13 @@ ensure_host_packages() {
return
fi

if ! command -v apt-get >/dev/null 2>&1; then
echo "error: missing required host packages and apt-get is unavailable: ${missing[*]}" >&2
if ! command -v apk >/dev/null 2>&1; then
echo "error: missing required host packages and apk is unavailable: ${missing[*]}" >&2
exit 1
fi

echo "installing missing host packages: ${missing[*]}"
apt-get update
apt-get install -y --no-install-recommends "${missing[@]}"
apk add --no-cache "${missing[@]}"
}

extract_base_rootfs() {
Expand Down Expand Up @@ -141,7 +140,7 @@ connection_messages true
EOF
}

require_env STARRY_BASE_ROOTFS "$base_rootfs"
require_env STARRY_ROOTFS "$base_rootfs"
require_env STARRY_STAGING_ROOT "$staging_root"
require_env STARRY_OVERLAY_DIR "$overlay_dir"

Expand Down
Loading