-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/stepper overlay update #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andre-stefanov
wants to merge
12
commits into
main
Choose a base branch
from
feature/stepper-overlay-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fcd2e82
Update device tree overlay and driver enable functions for stepper co…
andre-stefanov 4d26f3e
Update workflow triggers to only run on main branch for push events
andre-stefanov 1093619
Update device tree overlay for stepper control and adjust project con…
andre-stefanov 1c47763
Update device tree overlays and configurations for stepper control an…
andre-stefanov 2045d45
Refactor thread management and update device configuration structure …
andre-stefanov 815cc02
Merge branch 'main' into feature/stepper-overlay-update
andre-stefanov bbdade6
Refactor focuser initialization to include firmware version and remov…
andre-stefanov ab9ea2a
Add setup action for Zephyr project and update build workflow to use it
andre-stefanov d7ce4b1
Fix setup action path for Zephyr project in build workflow
andre-stefanov b4c04b1
Remove unnecessary path specification in checkout step of build workflow
andre-stefanov cc324b6
Update build workflow to use correct paths for Zephyr project and fir…
andre-stefanov 07adbca
Fix toolchain specification format in Zephyr setup action
andre-stefanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,252 @@ | ||
| name: Setup Zephyr project | ||
| description: Setup a Zephyr base project using west and downloading the Zephyr SDK | ||
|
|
||
| inputs: | ||
| app-path: | ||
| description: | | ||
| Application code path, should contain a west.yml file if | ||
| "manifest-file-name" is not specified, cannot contain multiple | ||
| directories (use base-path instead) | ||
| required: true | ||
|
|
||
| base-path: | ||
| description: | | ||
| Application base path, should contain the app-path. Defaults to "." if | ||
| unspecified | ||
| required: false | ||
| default: . | ||
|
|
||
| ccache-max-size: | ||
| description: | | ||
| Maximum size of the files stored in the compiler cache (ccache). Defaults to 512MB. | ||
| required: false | ||
| default: 512MB | ||
|
|
||
| enable-ccache: | ||
| description: | | ||
| Enable caching/restoring of compiler cache (ccache) files between invocations. | ||
| Defaults to 'true'. | ||
| required: false | ||
| default: true | ||
|
|
||
| ccache-cache-key: | ||
| description: | | ||
| An additional string used in the ccache cache key, use it to identify the | ||
| cache in a way that makes sense for compiled object cache reuse between | ||
| different build workflows. Default to "default". | ||
| required: false | ||
| default: default | ||
|
|
||
| manifest-file-name: | ||
| description: Name of the west workspace manifest file name in "app-path" | ||
| required: false | ||
| default: west.yml | ||
|
|
||
| sdk-version: | ||
| description: Zephyr SDK version to use or "auto" to detect automatically | ||
| required: false | ||
| default: auto | ||
|
|
||
| sdk-base: | ||
| description: Base URL of the Zephyr SDK | ||
| required: false | ||
| default: https://github.com/zephyrproject-rtos/sdk-ng/releases/download | ||
|
|
||
| toolchains: | ||
| description: List of toolchains to install, colon separated | ||
| required: false | ||
| default: arm-zephyr-eabi | ||
|
|
||
| west-project-filter: | ||
| description: West project filter | ||
| required: false | ||
| default: "" | ||
|
|
||
| west-group-filter: | ||
| description: West group filter | ||
| required: false | ||
| default: "" | ||
|
|
||
| west-version: | ||
| description: West version to install, latest if omitted | ||
| required: false | ||
| default: "" | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Install dependencies | ||
| shell: bash | ||
| run: | | ||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| python.exe -m pip install -U pip | ||
| fi | ||
|
|
||
| pip3 install -U pip wheel | ||
|
|
||
| if [ -n "${{ inputs.west-version }}" ]; then | ||
| pip3 install west==${{ inputs.west-version }} | ||
| else | ||
| pip3 install west | ||
| fi | ||
|
|
||
| if [ "${{ runner.os }}" = "Linux" ]; then | ||
| sudo rm -f /var/lib/man-db/auto-update | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y ninja-build ccache gperf | ||
| if [ "${{ runner.arch }}" = "X64" ]; then | ||
| sudo apt-get install -y libc6-dev-i386 g++-multilib | ||
| fi | ||
| elif [ "${{ runner.os }}" = "macOS" ]; then | ||
| brew install ninja ccache qemu dtc gperf | ||
| elif [ "${{ runner.os }}" = "Windows" ]; then | ||
| choco feature enable -n allowGlobalConfirmation | ||
| choco install ninja wget gperf | ||
| fi | ||
|
|
||
| - name: Initialize | ||
| working-directory: ${{ inputs.base-path }} | ||
| shell: bash | ||
| run: | | ||
| west init -l ${{ inputs.app-path }} --mf ${{ inputs.manifest-file-name }} | ||
| if [ -n "${{ inputs.west-group-filter }}" ]; then | ||
| west config manifest.group-filter -- ${{ inputs.west-group-filter }} | ||
| fi | ||
| if [ -n "${{ inputs.west-project-filter }}" ]; then | ||
| west config manifest.project-filter -- ${{ inputs.west-project-filter }} | ||
| fi | ||
| west update -o=--depth=1 -n | ||
|
|
||
| - name: Environment setup | ||
| working-directory: ${{ inputs.base-path }} | ||
| id: env-setup | ||
| shell: bash | ||
| run: | | ||
| runner="${{ runner.os }}-${{ runner.arch }}" | ||
| if [ "$runner" = "Linux-X64" ]; then | ||
| sdk_variant="linux-x86_64" | ||
| elif [ "$runner" = "Linux-ARM64" ]; then | ||
| sdk_variant="linux-aarch64" | ||
| elif [ "$runner" = "macOS-X64" ]; then | ||
| sdk_variant="macos-x86_64" | ||
| elif [ "$runner" = "macOS-ARM64" ]; then | ||
| sdk_variant="macos-aarch64" | ||
| elif [ "$runner" = "Windows-X64" ]; then | ||
| sdk_variant="windows-x86_64" | ||
| else | ||
| echo "Unsupported runner platform: $runner" | ||
| fi | ||
|
|
||
| if [ "${{ runner.os }}" = "Linux" ]; then | ||
| pip_cache_path="~/.cache/pip" | ||
| ccache_path="$HOME/.cache/ccache" | ||
| sdk_ext="tar.xz" | ||
| setup_file="./setup.sh" | ||
| setup_opt="-" | ||
| elif [ "${{ runner.os }}" = "macOS" ]; then | ||
| pip_cache_path="~/Library/Caches/pip" | ||
| ccache_path="$HOME/Library/Caches/ccache" | ||
| sdk_ext="tar.xz" | ||
| setup_file="./setup.sh" | ||
| setup_opt="-" | ||
| elif [ "${{ runner.os }}" = "Windows" ]; then | ||
| pip_cache_path="~/AppData/Local/pip/Cache" | ||
| ccache_path="$HOME/AppData/Local/ccache/Cache" | ||
| sdk_ext="7z" | ||
| setup_file="./setup.cmd" | ||
| setup_opt="//" | ||
| fi | ||
|
|
||
| if [ "${{ inputs.sdk-version }}" = "auto" ]; then | ||
| zephyr_path="zephyr" | ||
| if west list -f '{abspath}' zephyr; then | ||
| zephyr_path="$( west list -f '{abspath}' zephyr )" | ||
| fi | ||
|
|
||
| if [ -f "${zephyr_path}/SDK_VERSION" ]; then | ||
| echo "Reading SDK version from ${zephyr_path}/SDK_VERSION" | ||
| sdk_version=$( cat ${zephyr_path}/SDK_VERSION ) | ||
| else | ||
| echo "Cannot find ${zephyr_path}/SDK_VERSION" | ||
| exit 1 | ||
| fi | ||
| else | ||
| sdk_version="${{ inputs.sdk-version }}" | ||
| fi | ||
|
|
||
| echo "SDK_VERSION=${sdk_version}" >> $GITHUB_ENV | ||
| echo "SDK_FILE=zephyr-sdk-${sdk_version}_${sdk_variant}_minimal.${sdk_ext}" >> $GITHUB_ENV | ||
| echo "PIP_CACHE_PATH=${pip_cache_path}" >> $GITHUB_ENV | ||
| echo "CCACHE_TIMESTAMP=$(date +%s)" >> $GITHUB_ENV | ||
| echo "CCACHE_DIR=${ccache_path}" >> $GITHUB_ENV | ||
| echo "CCACHE_IGNOREOPTIONS=-specs=* --specs=*" >> $GITHUB_ENV | ||
| echo "SETUP_FILE=${setup_file}" >> $GITHUB_ENV | ||
| echo "SETUP_OPT=${setup_opt}" >> $GITHUB_ENV | ||
|
|
||
| - name: Cache Python packages | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ${{ env.PIP_CACHE_PATH }} | ||
| key: pip-${{ runner.os }}-${{ hashFiles(format('{0}/zephyr/scripts/requirements*.txt', inputs.base-path)) }} | ||
|
|
||
| - name: Install Python packages | ||
| working-directory: ${{ inputs.base-path }} | ||
| shell: bash | ||
| # The direct use of pip3 should be removed after zephyr 4.1 has been phased out, and the west | ||
| # command should only be used instead. | ||
| run: | | ||
| west packages pip --install --ignore-venv-check || pip3 install -r zephyr/scripts/requirements.txt | ||
|
|
||
| - name: Cache Zephyr SDK | ||
| id: cache-toolchain | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ${{ inputs.base-path }}/zephyr-sdk | ||
| key: ${{ env.SDK_FILE }}-${{ github.event.repository.name }}-${{ inputs.toolchains }} | ||
|
|
||
| - if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }} | ||
| working-directory: ${{ inputs.base-path }} | ||
| name: Download Zephyr SDK | ||
| shell: bash | ||
| run: | | ||
| wget --progress=dot:giga ${{ inputs.sdk-base }}/v${SDK_VERSION}/${SDK_FILE} | ||
| rm -rf zephyr-sdk | ||
| if [ "${{ runner.os }}" = "Windows" ]; then | ||
| 7z x $SDK_FILE | ||
| mv zephyr-sdk-${SDK_VERSION} zephyr-sdk | ||
| else | ||
| mkdir zephyr-sdk | ||
| tar xvf $SDK_FILE -C zephyr-sdk --strip-components=1 | ||
| fi | ||
| rm -f $SDK_FILE | ||
|
|
||
| - name: Setup Zephyr SDK | ||
| working-directory: ${{ inputs.base-path }}/zephyr-sdk | ||
| shell: bash | ||
| run: | | ||
| IFS=":" | ||
| TOOLCHAINS="${{ inputs.toolchains }}" | ||
| for toolchain in $TOOLCHAINS; do | ||
| ${SETUP_FILE} ${SETUP_OPT}t $toolchain | ||
| done | ||
| if [ ! -d sysroots ]; then | ||
| ${SETUP_FILE} ${SETUP_OPT}h | ||
| fi | ||
| ${SETUP_FILE} ${SETUP_OPT}c | ||
|
|
||
| - name: Cache ccache data | ||
| if: inputs.enable-ccache == 'true' && runner.os != 'Windows' | ||
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | ||
| with: | ||
| path: ${{ env.CCACHE_DIR }} | ||
| key: ccache-${{ inputs.ccache-cache-key }}-${{ env.CCACHE_TIMESTAMP }} | ||
| restore-keys: ccache-${{ inputs.ccache-cache-key }}- | ||
|
|
||
| - name: Set up ccache | ||
| if: inputs.enable-ccache == 'true' && runner.os != 'Windows' | ||
| shell: bash | ||
| run: | | ||
| mkdir -p ${{ env.CCACHE_DIR }} | ||
| ccache -M ${{ inputs.ccache-max-size }} | ||
| ccache -p | ||
| ccache -z -s -vv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is incomplete: "Used for" appears to be cut off mid-sentence. Please complete the documentation to explain what uart1 is used for (appears to be for logging and console output based on the chosen nodes).