返回 CodeWhale
ohos.yml
根目录 / .github / workflows / ohos.yml
1 name: OpenHarmony
2
3 on:
4 push:
5 branches: [main, master]
6 paths:
7 - '.github/workflows/ohos.yml'
8 - 'Cargo.lock'
9 - 'Cargo.toml'
10 - 'crates/**'
11 - 'scripts/ohos/**'
12 - 'scripts/ohos-env.sh'
13 - 'scripts/release/check-ohos-deps.sh'
14 pull_request:
15 branches: [main, master]
16 paths:
17 - '.github/workflows/ohos.yml'
18 - 'Cargo.lock'
19 - 'Cargo.toml'
20 - 'crates/**'
21 - 'scripts/ohos/**'
22 - 'scripts/ohos-env.sh'
23 - 'scripts/release/check-ohos-deps.sh'
24 schedule:
25 - cron: '47 7 * * 1'
26 workflow_dispatch:
27
28 permissions:
29 contents: read
30
31 concurrency:
32 group: ohos-${{ github.event.pull_request.number || github.ref }}
33 # Same as ci.yml: cancel superseded PR heads only; never cancel main pushes.
34 cancel-in-progress: ${{ github.event_name == 'pull_request' }}
35
36 env:
37 CARGO_TERM_COLOR: always
38 CARGO_INCREMENTAL: 0
39 RUSTFLAGS: -Dwarnings
40
41 jobs:
42 cargo-check:
43 name: cargo check (aarch64-unknown-linux-ohos)
44 runs-on: ubuntu-latest
45 timeout-minutes: 45
46 steps:
47 - uses: actions/checkout@v7
48 - name: Install Rust target
49 uses: dtolnay/rust-toolchain@stable
50 with:
51 targets: aarch64-unknown-linux-ohos
52 - name: Install OpenHarmony native SDK
53 id: ohos-sdk
54 # Pin the action: it downloads a published OpenHarmony SDK and verifies
55 # the archive checksum. This job must never substitute host headers or
56 # a stub sysroot and report that as target support.
57 uses: openharmony-rs/setup-ohos-sdk@b312caf8a43bb836aa24c08f65f97e1f09a89cad
58 with:
59 version: '6.1'
60 components: native
61 # Save the ~715 MB SDK cache from main only. The action has no
62 # restore-only mode, and with `cache: true` every PR ref that missed
63 # main's entry saved its own 715 MB copy; a handful of open PRs
64 # pushed the repo past the 10 GiB Actions cache cap and evicted the
65 # Rust caches CI actually depends on. PRs download the SDK instead
66 # (checksum-verified from the GitHub mirror below).
67 cache: ${{ github.ref == 'refs/heads/main' }}
68 mirror: true
69 - name: Check Codewhale TUI with the real SDK/sysroot
70 shell: bash
71 env:
72 OHOS_NATIVE_SDK: ${{ steps.ohos-sdk.outputs.ohos_sdk_native }}
73 run: |
74 set -euo pipefail
75 test -x "${OHOS_NATIVE_SDK}/llvm/bin/clang"
76 test -d "${OHOS_NATIVE_SDK}/sysroot"
77 . ./scripts/ohos-env.sh
78 cargo check --target aarch64-unknown-linux-ohos -p codewhale-tui --locked
79
79 lines YAML