diff --git a/.github/workflows/arduino_checks.yml b/.github/workflows/arduino_checks.yml new file mode 100644 index 0000000..d804acf --- /dev/null +++ b/.github/workflows/arduino_checks.yml @@ -0,0 +1,16 @@ +name: Arduino Checks + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + Arduino-Checks: + uses: sensirion/.github/.github/workflows/upt.arduino.check.yml@main + with: + expect-arduino-examples: true + lint-lib-manager-check: update diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 650a1f8..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -stages: - - validate - - test - -compile_test_shdlc: - stage: test - image: - name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-arduino:0.5.0 - tags: [docker, linux] - script: - - tests/compile_test.py -s examples/AllCommandsShdlc/ - -compile_test_i2c: - stage: test - image: - name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-arduino:0.5.0 - tags: [docker, linux] - script: - - tests/compile_test.py -s examples/AllCommandsI2c/ - -syntax_check: - stage: validate - image: - name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-python:3.8-20.04-2.7.0 - tags: [linux, docker] - before_script: - # For performance and stability reasons, use offline installation. - - pip install --no-index --find-links=/pip editorconfig-checker - - pip install flake8 - - apt-get update && apt-get install -yq clang-format-6.0 - script: - - tests/syntax_check.sh - -cppcheck: - stage: validate - image: registry.gitlab.sensirion.lokal/sensirion/docker/docker-cppcheck:1.0.0 - tags: [linux, docker] - script: - - tests/run_cppcheck.sh diff --git a/tests/compile_test.py b/tests/compile_test.py deleted file mode 100755 index 81c543a..0000000 --- a/tests/compile_test.py +++ /dev/null @@ -1,45 +0,0 @@ -#! /usr/bin/env python3 -import subprocess -import json -import argparse -import sys -import logging - - -def main(): - parser = argparse.ArgumentParser() - parser.description = u'Compile test a sketch for all available boards' - parser.add_argument(u'-s', u'--sketch', dest=u'sketch', - required=True, help=u'Path to sketch') - args = parser.parse_args() - test_all_boards(args.sketch) - - -def test_all_boards(sketch): - logging.basicConfig(level=logging.INFO, - format='%(asctime)s [%(levelname)s] %(message)s') - log = logging.getLogger('arduino-compile-test') - process = subprocess.run("arduino-cli board listall --format json".split(), - stdout=subprocess.PIPE) - board_list_json = process.stdout.decode('utf-8') - board_list = json.loads(board_list_json) - test_list = ["arduino:samd:mkrzero", "arduino:avr:mega", - "arduino:avr:nano", "arduino:avr:uno", - "esp32:esp32:esp32", "esp8266:esp8266:generic"] - for board in test_list: - if board in (b['fqbn'] for b in board_list['boards']): - log.info('Test compilation for board {}'.format(board)) - command = 'arduino-cli compile --libraries="." --warnings all'\ - ' --fqbn {board} {sketch}'.format(board=board, - sketch=sketch) - process = subprocess.run(command.split(), stdout=subprocess.PIPE) - if process.returncode: - log.error(process.stdout.decode('utf-8')) - sys.exit(process.returncode) - else: - log.error('Board not installed: {}'.format(board)) - sys.exit(-1) - - -if __name__ == '__main__': - main() diff --git a/tests/run_cppcheck.sh b/tests/run_cppcheck.sh deleted file mode 100755 index 60d620b..0000000 --- a/tests/run_cppcheck.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -euxo pipefail -cppcheck --std=c++11 --language=c++ --error-exitcode=1 --enable=warning,style,performance,portability src/* diff --git a/tests/syntax_check.sh b/tests/syntax_check.sh deleted file mode 100755 index 53aeaba..0000000 --- a/tests/syntax_check.sh +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/bash -set -euxo pipefail -editorconfig-checker -flake8 -find . -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format-6.0 -i -style=file {} \; && git diff --exit-code