Skip to content

Commit

Permalink
Fix CI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jschwe authored May 12, 2024
1 parent 8e92cf6 commit b37afda
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: ./
id: setup_sdk
- name: Checkout
uses: actions/checkout@v4
- name: Setup SDK
uses: ./
with:
cache: false
- name: Test clang is installed
run: "${OHOS_SDK_NATIVE}/llvm/bin/clang" --version
shell: bash

- name: Test
run: bash -c '"${OHOS_SDK_NATIVE}/llvm/bin/clang" --version'
16 changes: 8 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
cache:
description: "Whether to cache the SDK or not"
required: false
default: true
default: 'true'
outputs:
sdk-path:
description: "Directory of the OpenHarmony SDK"
Expand All @@ -21,33 +21,33 @@ outputs:
value: ${{ steps.set_outputs.outputs.sdk-version }}
api-version:
description: "OpenHarmony API version of the SDK"
api-version: ${{ steps.set_outputs.outputs.api-version }}
value: ${{ steps.set_outputs.outputs.api-version }}
runs:
using: "composite"
steps:
- name: Set Greeting
run: echo "Hello ${{ inputs.version }}."
- name: Debug
shell: bash
run: echo "Cache ${{ inputs.cache }}, version ${{ inputs.version }}"
- name: Cache SDK
id: cache
uses: actions/cache@v4
with:
path: ohos-sdk
path: ~/ohos-sdk
key: ${{ runner.os }}-ohos-sdk-${{ inputs.version }}
if: ${{ inputs.cache }} == 'true'
if: ${{ inputs.cache == 'true' }}
- name: Download and install OpenHarmony SDK
id: install_ohos_sdk
run: ./install_ohos_sdk.sh
shell: bash
if: ${{ inputs.cache }} != 'true' || steps.cache.outputs.cache-hit != 'true'
if: ${{ inputs.cache != 'true' || steps.cache.outputs.cache-hit != 'true' }}
env:
INPUT_VERSION: "${{ inputs.version }}"
- name: Set Outputs
id: set_outputs
shell: bash
run: |
echo "sdk-path=$HOME/ohos-sdk" >> "$GITHUB_OUTPUT"
OHOS_SDK_NATIVE="$HOME/ohos-sdk/*/native"
OHOS_SDK_NATIVE="$(cd $HOME/ohos-sdk/*/native && pwd)"
echo "OHOS_SDK_NATIVE=${OHOS_SDK_NATIVE}" >> "$GITHUB_ENV"
echo "ohos_sdk_native=${OHOS_SDK_NATIVE}" >> "$GITHUB_OUTPUT"
cd "${OHOS_SDK_NATIVE}"
Expand Down
6 changes: 3 additions & 3 deletions install_ohos_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ echo "Downloading OHOS SDK from ${DOWNLOAD_URL}"

curl --fail -L -o "${HOME}/openharmony-sdk.tar.gz" "${DOWNLOAD_URL}"
cd "${HOME}"
if [[ "${OS}" == "linux" ]]; then
tar -xvf openharmony-sdk.tar.gz --strip-components=2
if [[ "${OS}" == "mac" ]]; then
tar -xf openharmony-sdk.tar.gz --strip-components=2
else
tar -xvf openharmony-sdk.tar.gz
tar -xf openharmony-sdk.tar.gz
fi
rm openharmony-sdk.tar.gz
cd ohos-sdk
Expand Down

0 comments on commit b37afda

Please sign in to comment.