Create cmake-single-platform.yml #4
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
| name: STM32 CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # سورس کد رو میاره | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # نصب ابزارها | |
| - name: Install ARM GCC Toolchain and CMake | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake ninja-build gcc-arm-none-eabi | |
| # کانفیگ پروژه (فرض بر اینه که CMakeLists داری) | |
| - name: Configure project | |
| run: cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=cmake/arm-gcc-toolchain.cmake | |
| # بیلد پروژه | |
| - name: Build project | |
| run: cmake --build build --config Release | |
| # ذخیره خروجی firmware به عنوان artifact | |
| - name: Upload firmware | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: firmware | |
| path: build/*.bin |