| 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 | cache: true |
| 62 | mirror: true |
| 63 | - name: Check Codewhale TUI with the real SDK/sysroot |
| 64 | shell: bash |
| 65 | env: |
| 66 | OHOS_NATIVE_SDK: ${{ steps.ohos-sdk.outputs.ohos_sdk_native }} |
| 67 | run: | |
| 68 | set -euo pipefail |
| 69 | test -x "${OHOS_NATIVE_SDK}/llvm/bin/clang" |
| 70 | test -d "${OHOS_NATIVE_SDK}/sysroot" |
| 71 | . ./scripts/ohos-env.sh |
| 72 | cargo check --target aarch64-unknown-linux-ohos -p codewhale-tui --locked |
| 73 |