|
| 1 | +name: Kamaji -- Build HITL Base |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '**' # Run it on all branches |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build_sustainer: |
| 11 | + name: Build MIDAS:mcu_hilsim_sustainer |
| 12 | + runs-on: ubuntu-latest |
| 13 | + defaults: |
| 14 | + run: |
| 15 | + working-directory: MIDAS |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v3 |
| 18 | + - name: Cache pip |
| 19 | + uses: actions/cache@v3 |
| 20 | + with: |
| 21 | + path: ~/.cache/pip |
| 22 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 23 | + restore-keys: | |
| 24 | + ${{ runner.os }}-pip- |
| 25 | + - name: Cache PlatformIO |
| 26 | + uses: actions/cache@v3 |
| 27 | + with: |
| 28 | + path: ~/.platformio |
| 29 | + key: ${{ runner.os }}-pio-${{ hashFiles('**/platformio.ini') }} |
| 30 | + restore-keys: | |
| 31 | + ${{ runner.os }}-pio- |
| 32 | + - name: Set up Python |
| 33 | + uses: actions/setup-python@v4 |
| 34 | + with: |
| 35 | + python-version: '3.11' |
| 36 | + - name: Install PlatformIO |
| 37 | + run: | |
| 38 | + python -m pip install --upgrade pip |
| 39 | + pip install --upgrade platformio |
| 40 | + - name: PlatformIO version |
| 41 | + run: pio --version |
| 42 | + - name: Build mcu_hilsim_sustainer |
| 43 | + run: pio run -e mcu_hilsim_sustainer |
| 44 | + - name: Upload Artifact for mcu_hilsim_sustainer |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: firmware-mcu_hilsim_sustainer |
| 48 | + path: MIDAS/.pio/build/mcu_hilsim_sustainer/firmware*.* |
| 49 | + |
| 50 | + build_booster: |
| 51 | + name: Build MIDAS:mcu_hilsim_booster |
| 52 | + runs-on: ubuntu-latest |
| 53 | + defaults: |
| 54 | + run: |
| 55 | + working-directory: MIDAS |
| 56 | + steps: |
| 57 | + - uses: actions/checkout@v3 |
| 58 | + - name: Cache pip |
| 59 | + uses: actions/cache@v3 |
| 60 | + with: |
| 61 | + path: ~/.cache/pip |
| 62 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 63 | + restore-keys: | |
| 64 | + ${{ runner.os }}-pip- |
| 65 | + - name: Cache PlatformIO |
| 66 | + uses: actions/cache@v3 |
| 67 | + with: |
| 68 | + path: ~/.platformio |
| 69 | + key: ${{ runner.os }}-pio-${{ hashFiles('**/platformio.ini') }} |
| 70 | + restore-keys: | |
| 71 | + ${{ runner.os }}-pio- |
| 72 | + - name: Set up Python |
| 73 | + uses: actions/setup-python@v4 |
| 74 | + with: |
| 75 | + python-version: '3.11' |
| 76 | + - name: Install PlatformIO |
| 77 | + run: | |
| 78 | + python -m pip install --upgrade pip |
| 79 | + pip install --upgrade platformio |
| 80 | + - name: PlatformIO version |
| 81 | + run: pio --version |
| 82 | + - name: Build mcu_hilsim_booster |
| 83 | + run: pio run -e mcu_hilsim_booster |
| 84 | + - name: Upload Artifact for mcu_hilsim_booster |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: firmware-mcu_hilsim_booster |
| 88 | + path: MIDAS/.pio/build/mcu_hilsim_booster/firmware*.* |
| 89 | + |
| 90 | + notify: |
| 91 | + name: Slack Notification (main) |
| 92 | + needs: [build_sustainer, build_booster] |
| 93 | + runs-on: ubuntu-latest |
| 94 | + if: github.ref == 'refs/heads/main' |
| 95 | + steps: |
| 96 | + - name: Send Slack Summary |
| 97 | + uses: rtCamp/action-slack-notify@v2 |
| 98 | + env: |
| 99 | + SLACK_COLOR: ${{ (needs.build_sustainer.result == 'success' && needs.build_booster.result == 'success') && 'good' || 'danger' }} |
| 100 | + SLACK_TITLE: "Kamaji Firmware Build" |
| 101 | + SLACK_MESSAGE: | |
| 102 | + Build results: |
| 103 | + - *MIDAS:mcu_hilsim_sustainer*: ${{ needs.build_sustainer.result }} |
| 104 | + - *MIDAS:mcu_hilsim_booster*: ${{ needs.build_booster.result }} |
| 105 | +
|
| 106 | + :information_source: CI Notifications only run on the `main` branch. |
| 107 | + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }} |
0 commit comments