Skip to content

Commit

Permalink
feat: allow choosing SDK components via input parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mukilan authored and jschwe committed Aug 15, 2024
1 parent e17dc16 commit 7464d26
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SDK
id: initial-setup
uses: ./
with:
cache: false
- name: Test
run: bash -c '"${OHOS_SDK_NATIVE}/llvm/bin/clang" --version'
run: bash -c '"${OHOS_SDK_NATIVE}/llvm/bin/clang" --version'
- name: Remove previous SDK installation
env:
SDK_PATH: "${{ steps.initial-setup.outputs.sdk-path }}"
run: bash -c 'rm -rf "${SDK_PATH}"'
- name: Setup SDK with Components
id: sdk-with-components
uses: ./
with:
components: "native;toolchains"
- name: Test
shell: bash
env:
SDK_PATH: "${{ steps.sdk-with-components.outputs.sdk-path }}"
run: |
${OHOS_SDK_NATIVE}/llvm/bin/clang --version
${SDK_PATH}/*/toolchains/hdc --version
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ inputs:
description: "Whether to cache the SDK or not"
required: false
default: 'true'
components:
description: "Semicolon separated list of SDK components that should be made available"
required: false
default: 'native'
outputs:
sdk-path:
description: "Directory of the OpenHarmony SDK"
Expand Down Expand Up @@ -47,6 +51,7 @@ runs:
if: ${{ inputs.cache != 'true' || steps.cache.outputs.cache-hit != 'true' }}
env:
INPUT_VERSION: "${{ inputs.version }}"
INPUT_COMPONENTS: "${{ inputs.components }}"
- name: Set Outputs
id: set_outputs
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions install_ohos_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ else
cd darwin
fi

# Todo: expose available components via an input variable.
# For now just extract native, to save disk space

unzip native-*.zip
IFS=";" read -ra COMPONENTS <<< "${INPUT_COMPONENTS}"
for COMPONENT in ${COMPONENTS[@]}
do
echo "Extracting component ${COMPONENT}"
unzip ${COMPONENT}-*.zip
done
rm ./*.zip

cd native

0 comments on commit 7464d26

Please sign in to comment.