Skip to content

Commit

Permalink
try gh action build
Browse files Browse the repository at this point in the history
  • Loading branch information
xythobuz committed Dec 20, 2023
1 parent 4c9ccdb commit bafb079
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# https://github.com/raspberrypi/pico-examples/blob/master/.github/workflows/cmake.yml

name: CMake
on: [push, pull_request]

env:
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Clean workspace
run: |
echo "Cleaning up previous run"
rm -rf "${{ github.workspace }}"
mkdir -p "${{ github.workspace }}"
- name: Checkout repo
uses: actions/checkout@v3
with:
path: repo

- name: Checkout repo submodules
working-directory: ${{github.workspace}}/repo
run: git submodule update --init

- name: Checkout pico-sdk submodules
working-directory: ${{github.workspace}}/repo/pico-sdk
run: git submodule update --init

- name: Create Build Environment
working-directory: ${{github.workspace}}/repo
run: cmake -E make_directory ${{github.workspace}}/repo/build

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/repo/build
run: cmake .. -DPICO_BOARD=pico_w -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Get core count
id: core_count
run : cat /proc/cpuinfo | grep processor | wc -l

- name: Build
working-directory: ${{github.workspace}}/repo/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config $BUILD_TYPE --parallel $(nproc)

- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.0.0
with:
name: firmware.uf2
path: ${{github.workspace}}/repo/build/picowota_gadget.uf2
if-no-files-found: error

- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.0.0
with:
name: update.elf
path: ${{github.workspace}}/repo/build/gadget.elf
if-no-files-found: error

0 comments on commit bafb079

Please sign in to comment.