Migrate from WifiManager to Autoconnect #402
This file contains 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: unittest | |
on: | |
workflow_dispatch: null | |
pull_request: | |
push: | |
tags: | |
- '**' | |
jobs: | |
unittest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: lukka/[email protected] | |
with: | |
cmakeVersion: "~3.25.0" # <--= optional, use most recent 3.25.x version | |
- name: prepare directory | |
working-directory: ./tests | |
run: mkdir -p build | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
./tests/build/_deps/ | |
key: cmake-deps | |
- name: cmake prepareBuild | |
working-directory: ./tests/build | |
run: cmake -DCMAKE_BUILD_TYPE=Release .. | |
- name: cmake build (compile) project | |
working-directory: ./tests/build | |
run: cmake --build . | |
- name: run ctest | |
working-directory: ./tests/build | |
run: ctest -V | |
build: | |
needs: unittest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- envName: esp32s | |
- envName: esp32cc1101 | |
- envName: esp8266s | |
- envName: esp8266cc1101 | |
- envName: MAPLEMINI_F103CBs | |
- envName: MAPLEMINI_F103CBcc1101 | |
- envName: nano328 | |
- envName: nanoCC1101 | |
- envName: miniculCC1101 | |
- envName: promini8cc1101 | |
- envName: promini16cc1101 | |
- envName: promini8s | |
- envName: promini16s | |
- envName: radinoCC1101 | |
- envName: wemos_d1_mini_proCC1101 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/pip | |
~/.platformio/.cache | |
key: ${{ matrix.envName }}-pio | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: cpp | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install PlatformIO Core | |
run: pip install --upgrade platformio | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- name: Run PlatformIO and compile sketch | |
id: compile_sketch | |
run: | | |
export COMPILE_OUTPUT=$(pio run -e ${{ matrix.envName }} ) | |
echo "$COMPILE_OUTPUT" | |
FILEEXT=$(find .pio/build/${{ matrix.envName }} -maxdepth 1 \( -name 'SIGNALDuino*.bin' -o -name 'SIGNALDuino*.hex' \) | while read file; do echo "${file##*.}"; done) | |
FILENAME=$(find .pio/build/${{ matrix.envName }}/ -maxdepth 1 \( -name 'SIGNALDuino*.bin' -o -name 'SIGNALDuino*.hex' \) -printf "%f" ) | |
echo "Extension: $FILEEXT" | |
echo "FILENAME=$(echo $FILENAME | tr -d '\n')" >> $GITHUB_OUTPUT | |
echo "FILEEXT=$(echo $FILEEXT | tr -d '\n')" >> $GITHUB_OUTPUT | |
echo "SKETCHSIZE=$(echo "$COMPILE_OUTPUT" | grep -Po "(^Flash: ).*")" >> $GITHUB_OUTPUT | |
echo "GLOBALRAMUSAGE=$(echo "$COMPILE_OUTPUT" | grep -Po "(^RAM: ).*")" >> $GITHUB_OUTPUT | |
- name: Create Job Summary | |
run: | | |
echo "### Size report for commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY | |
echo "| ENV | Flash | Ram |" >> $GITHUB_STEP_SUMMARY | |
echo "|-------|-------|-----|" >> $GITHUB_STEP_SUMMARY | |
echo "| ${{ matrix.envName }} | ${{ steps.compile_sketch.outputs.SKETCHSIZE }} | ${{ steps.compile_sketch.outputs.GLOBALRAMUSAGE }} |" >> $GITHUB_STEP_SUMMARY | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/board:${{matrix.envName}}" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.compile_sketch.outputs.FILENAME }} | |
path: | | |
.pio/build/${{ matrix.envName }}/${{ steps.compile_sketch.outputs.FILENAME }} | |
if-no-files-found: warn | |
release: | |
needs: build | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
id: download | |
uses: actions/download-artifact@v4 | |
- name: 'Echo download path' | |
run: ls -R ${{steps.download.outputs.download-path}} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
draft: true | |
files: | | |
${{steps.download.outputs.download-path}}/SIGNALDuino*/SIGNALDuino* |