From 80712dd6a901c837f6156f596f2020c123cebeba Mon Sep 17 00:00:00 2001 From: Maximilian Paulsen Date: Wed, 28 Feb 2024 13:08:40 +0100 Subject: [PATCH] Moves CI to github --- .github/workflows/arduino.yml | 21 ++++++++++++++++ .github/workflows/platformio.yml | 39 +++++++++++++++++++++++++++++ .gitlab-ci.yml | 42 -------------------------------- 3 files changed, 60 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/arduino.yml create mode 100644 .github/workflows/platformio.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/arduino.yml b/.github/workflows/arduino.yml new file mode 100644 index 0000000..19af482 --- /dev/null +++ b/.github/workflows/arduino.yml @@ -0,0 +1,21 @@ +name: Arduino Lib + +on: + pull_request: + branches: + - master + +jobs: + arduino-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/arduino-lint-action@v1 + + arduino-ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Arduino-CI/action@stable-1.x + env: + EXPECT_EXAMPLES: true diff --git a/.github/workflows/platformio.yml b/.github/workflows/platformio.yml new file mode 100644 index 0000000..4ff69df --- /dev/null +++ b/.github/workflows/platformio.yml @@ -0,0 +1,39 @@ +name: PIO Lib + +on: + pull_request: + branches: + - main + push: + branches: + - main + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +jobs: + PlatformIO-Check: + uses: sensirion/.github/.github/workflows/platformio_check.yml@main + with: + pio-environment-list: '["GetLiveValues", "develop"]' + + PlatformIO-Build: + uses: sensirion/.github/.github/workflows/platformio_build.yml@main + needs: PlatformIO-Check + with: + pio-environment-list: '["GetLiveValues", "develop"]' + + PlatformIO-Package: + if: ${{ (github.ref_type != 'tag') && (github.ref_name == 'main') }} + needs: PlatformIO-Build + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main + with: + should-publish: false + + PlatformIO-Publish: + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main + if: github.ref_type == 'tag' + needs: PlatformIO-Build + with: + should-publish: true + secrets: + pio-registry-token: ${{ secrets.PIO_MKTSW_TOKEN }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 00645cf..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,42 +0,0 @@ -stages: - - validate - - compile - -compile_pio: - stage: compile - image: - name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-arduino:0.6.0 - tags: [docker, linux] - parallel: - matrix: - - env: [GetLiveValues, develop] - script: - - pio run --environment ${env} - -syntax_check: - stage: validate - image: - name: registry.gitlab.sensirion.lokal/sensirion/docker/docker-ubuntu:22.04-1.6.0 - tags: [linux, docker] - before_script: - - apt update - - apt-get install -yq clang-format-14 - script: - - find . -type f -iregex ".*\.\(c\|h\|cpp\|ino\)" -exec clang-format-14 -i -style=file {} \; && git diff --exit-code - -cppcheck: - stage: validate - image: - name: registry.gitlab.sensirion.lokal/mso-sw/drivers/docker-driver-generator:0.2.0 - tags: [linux, docker] - script: - - cppcheck --std=c++11 --language=c++ --error-exitcode=1 --enable=warning,style,performance,portability --suppressions-list=.cppcheck_suppressions.txt src/* examples/* - -TODO_check: - stage: validate - image: - name: registry.gitlab.sensirion.lokal/mso-sw/drivers/docker-driver-generator:0.2.0 - tags: [linux, docker] - script: - - '! grep -rnw --exclude=.gitlab-ci.yml --exclude-dir=.git . -e "TODO"' - \ No newline at end of file