| 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 | cancel-in-progress: true |
| 34 | |
| 35 | env: |
| 36 | CARGO_TERM_COLOR: always |
| 37 | CARGO_INCREMENTAL: 0 |
| 38 | RUSTFLAGS: -Dwarnings |
| 39 | |
| 40 | jobs: |
| 41 | cargo-check: |
| 42 | name: cargo check (aarch64-unknown-linux-ohos) |
| 43 | runs-on: ubuntu-latest |
| 44 | timeout-minutes: 45 |
| 45 | steps: |
| 46 | - uses: actions/checkout@v7 |
| 47 | - name: Install Rust target |
| 48 | uses: dtolnay/rust-toolchain@stable |
| 49 | with: |
| 50 | targets: aarch64-unknown-linux-ohos |
| 51 | - name: Install OpenHarmony native SDK |
| 52 | id: ohos-sdk |
| 53 | # Pin the action: it downloads a published OpenHarmony SDK and verifies |
| 54 | # the archive checksum. This job must never substitute host headers or |
| 55 | # a stub sysroot and report that as target support. |
| 56 | uses: openharmony-rs/setup-ohos-sdk@b312caf8a43bb836aa24c08f65f97e1f09a89cad |
| 57 | with: |
| 58 | version: '6.1' |
| 59 | components: native |
| 60 | cache: true |
| 61 | mirror: true |
| 62 | - name: Check Codewhale TUI with the real SDK/sysroot |
| 63 | shell: bash |
| 64 | env: |
| 65 | OHOS_NATIVE_SDK: ${{ steps.ohos-sdk.outputs.ohos_sdk_native }} |
| 66 | run: | |
| 67 | set -euo pipefail |
| 68 | test -x "${OHOS_NATIVE_SDK}/llvm/bin/clang" |
| 69 | test -d "${OHOS_NATIVE_SDK}/sysroot" |
| 70 | . ./scripts/ohos-env.sh |
| 71 | cargo check --target aarch64-unknown-linux-ohos -p codewhale-tui --locked |
| 72 |