diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..569e767 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + # we'll add windows-latest later + os: [ubuntu-latest, macos-latest] + + steps: + - uses: + - actions/checkout@v2 + - carlosperate/arm-none-eabi-gcc-action@v1 + + - name: Build + shell: bash + run: | + ./build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index aacff96..04195d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,8 +13,14 @@ set(PICO_SDK_FETCH_FROM_GIT on) include(cmake/pico_sdk_import.cmake) -# copy it over from cmake/credentials.cmake.example -include(cmake/credentials.cmake) +if(EXISTS cmake/credentials.cmake) + # copy it over from cmake/credentials.cmake.example + include(cmake/credentials.cmake) +else() + message(WARNING "Credentials file not found, using default values!") + set(WIFI_SSID "SSID" CACHE INTERNAL "WiFi SSID for examples") + set(WIFI_PASSWORD "password" CACHE INTERNAL "WiFi password for examples") +endif() project(pico_w_webserver C CXX ASM) set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) diff --git a/build.sh b/build.sh index db0008d..6ee98f4 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,11 @@ #!/bin/sh if which ninja >/dev/null; then - cmake -B build -G Ninja $1 + cmake -B build -G Ninja $1 && \ ninja -C build $1 else - cmake -B build $1 - make -j $(getconf _NPROCESSORS_ONLN) -C build $1 + cmake -B build $1 && \ + make -j $(getconf _NPROCESSORS_ONLN) -C build $1 && \ echo "done. P.S.: Consider installing ninja - it's faster" fi +exit $? \ No newline at end of file