From ea1e9620d3fc53f140a39ecbf5b09266b1b467b5 Mon Sep 17 00:00:00 2001 From: Carl Sutton Date: Thu, 1 Oct 2020 21:54:47 +0200 Subject: [PATCH] Add workflow for codeql --- .github/workflows/codeql-analysis.yml | 63 +++++++++++++++++ Makefile | 11 +++ platform.json | 98 +++++++++++++++++++++++++++ platformio.ini | 15 ++++ 4 files changed, 187 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 Makefile create mode 100644 platform.json diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..bb695b9 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,63 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + branches: [master] + schedule: + - cron: '0 21 * * 3' + +jobs: + test-building: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + environment: [nodemcuv2, d1_mini_lite] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.x + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U https://github.com/platformio/platformio/archive/develop.zip + platformio platform install file://. + pio platform uninstall espressif8266 + cp include/settings.example.h include/settings.h + - name: Build + run: | + platformio run -e ${{ matrix.environment }} -d . + + codeql: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: 3.x + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -U https://github.com/platformio/platformio/archive/develop.zip + platformio platform install file://. + pio platform uninstall espressif8266 + cp include/settings.example.h include/settings.h + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: cpp + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..449debc --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +ENVIRONMENT ?= nodemcuv2 + +.PHONY: all +all: + +.PHONY: clean +clean: + +.PHONY: build +build: clean + platformio run -e $(ENVIRONMENT) -d . \ No newline at end of file diff --git a/platform.json b/platform.json new file mode 100644 index 0000000..d86a38b --- /dev/null +++ b/platform.json @@ -0,0 +1,98 @@ +{ + "name": "espressif8266", + "title": "Espressif 8266", + "description": "Espressif Systems is a privately held fabless semiconductor company. They provide wireless communications and Wi-Fi chips which are widely used in mobile devices and the Internet of Things applications.", + "homepage": "https://espressif.com/", + "license": "Apache-2.0", + "keywords": [ + "dev-platform", + "Wi-Fi", + "Xtensa", + "106Micro" + ], + "engines": { + "platformio": "^5" + }, + "repository": { + "type": "git", + "url": "https://github.com/platformio/platform-espressif8266.git" + }, + "version": "2.6.2", + "frameworks": { + "arduino": { + "package": "framework-arduinoespressif8266", + "script": "builder/frameworks/arduino.py" + }, + "simba": { + "package": "framework-simba", + "script": "builder/frameworks/simba.py" + }, + "esp8266-rtos-sdk": { + "package": "framework-esp8266-rtos-sdk", + "script": "builder/frameworks/esp8266-rtos-sdk.py", + "description": "ESP8266 SDK based on FreeRTOS, a truly free professional grade RTOS for microcontrollers", + "homepage": "https://github.com/espressif/ESP8266_RTOS_SDK", + "title": "ESP8266 RTOS SDK" + }, + "esp8266-nonos-sdk": { + "package": "framework-esp8266-nonos-sdk", + "script": "builder/frameworks/esp8266-nonos-sdk.py", + "description": "The non-OS SDK provides a set of application programming interfaces (APIs) for core ESP8266 functionalities such as data reception/transmission over Wi-Fi, TCP/IP stack functions, hardware interface functions and basic system management functions", + "homepage": "https://github.com/espressif/ESP8266_NONOS_SDK", + "title": "ESP8266 Non-OS SDK" + } + }, + "packages": { + "toolchain-xtensa": { + "type": "toolchain", + "owner": "platformio", + "version": "~2.40802.191122" + }, + "framework-arduinoespressif8266": { + "type": "framework", + "optional": true, + "owner": "platformio", + "version": "~3.20704.0" + }, + "framework-esp8266-rtos-sdk": { + "type": "framework", + "optional": true, + "owner": "platformio", + "version": ">=1.5.0-beta" + }, + "framework-esp8266-nonos-sdk": { + "type": "framework", + "optional": true, + "owner": "platformio", + "version": ">=2.1.0" + }, + "framework-simba": { + "type": "framework", + "optional": true, + "owner": "platformio", + "version": ">=7.0.0" + }, + "tool-esptool": { + "type": "uploader", + "owner": "platformio", + "version": "<2" + }, + "tool-esptoolpy": { + "type": "uploader", + "owner": "platformio", + "version": "~1.20800.0" + }, + "tool-mkspiffs": { + "type": "uploader", + "optional": true, + "owner": "platformio", + "version": "~1.200.0" + }, + "tool-mklittlefs": { + "type": "uploader", + "optional": true, + "owner": "platformio", + "version": "~1.203.0" + } + } +} diff --git a/platformio.ini b/platformio.ini index fb4b907..2312365 100755 --- a/platformio.ini +++ b/platformio.ini @@ -7,6 +7,21 @@ ; ; Please visit documentation for the other options and examples ; https://docs.platformio.org/page/projectconf.html +[env:nodemcuv2] +platform = espressif8266 +board = nodemcuv2 +upload_port = /dev/ttyUSB0 +framework = arduino +lib_deps = + PubSubClient + ArduinoJson@>=6.11.3 + Ticker +#upload_protocol = espota +#upload_port = 192.168.1.165 +; Serial Monitor options +monitor_speed = 115200 +build_flags = -DMQTT_MAX_PACKET_SIZE=256 + [env:d1_mini_lite] platform = espressif8266 board = d1_mini_lite