From 2af096a79266a7d6c977c54948d36ad651bc5cd0 Mon Sep 17 00:00:00 2001 From: Quentin Fisch Date: Tue, 27 Feb 2024 13:59:52 +0100 Subject: [PATCH 1/2] Use shared workflow from Sensirion --- ...platformio_workflow.yml => platformio.yml} | 8 +-- .../workflows/platformio_build_template.yml | 35 ---------- .../workflows/platformio_check_template.yml | 34 ---------- .../workflows/platformio_publish_template.yml | 64 ------------------- 4 files changed, 4 insertions(+), 137 deletions(-) rename .github/workflows/{platformio_workflow.yml => platformio.yml} (72%) delete mode 100644 .github/workflows/platformio_build_template.yml delete mode 100644 .github/workflows/platformio_check_template.yml delete mode 100644 .github/workflows/platformio_publish_template.yml diff --git a/.github/workflows/platformio_workflow.yml b/.github/workflows/platformio.yml similarity index 72% rename from .github/workflows/platformio_workflow.yml rename to .github/workflows/platformio.yml index 2559031..492a98c 100644 --- a/.github/workflows/platformio_workflow.yml +++ b/.github/workflows/platformio.yml @@ -12,12 +12,12 @@ on: jobs: PlatformIO-Check: - uses: ./.github/workflows/platformio_check_template.yml + uses: sensirion/.github/.github/workflows/platformio_check.yml@main with: pio-environment-list: '["ble_example", "basicUsage"]' PlatformIO-Build: - uses: ./.github/workflows/platformio_build_template.yml + uses: sensirion/.github/.github/workflows/platformio_build.yml@main needs: PlatformIO-Check with: pio-environment-list: '["ble_example", "basicUsage"]' @@ -25,12 +25,12 @@ jobs: PlatformIO-Package: if: ${{ (github.ref_type != 'tag') && (github.ref_name == 'master') }} needs: PlatformIO-Build - uses: ./.github/workflows/platformio_publish_template.yml + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main with: should-publish: false PlatformIO-Publish: - uses: ./.github/workflows/platformio_publish_template.yml + uses: sensirion/.github/.github/workflows/platformio_publish.yml@main if: github.ref_type == 'tag' needs: PlatformIO-Build with: diff --git a/.github/workflows/platformio_build_template.yml b/.github/workflows/platformio_build_template.yml deleted file mode 100644 index c7b75dc..0000000 --- a/.github/workflows/platformio_build_template.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: PlatformIO Build - -on: - workflow_call: - inputs: - pio-environment-list: - type: string - default: '["usage_example"]' - pio-ini-location: - type: string - default: "." - -jobs: - platformio-build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - environment: ${{ fromJSON(inputs.pio-environment-list) }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Build examples with 'pio run' - working-directory: ${{ inputs.pio-ini-location }} - run: pio run -e ${{ matrix.environment }} diff --git a/.github/workflows/platformio_check_template.yml b/.github/workflows/platformio_check_template.yml deleted file mode 100644 index be39b44..0000000 --- a/.github/workflows/platformio_check_template.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: PlatformIO Check - -on: - workflow_call: - inputs: - pio-environment-list: - type: string - default: '["usage_example"]' - pio-ini-location: - type: string - default: "." - -jobs: - platformio-check: - runs-on: ubuntu-latest - strategy: - matrix: - environment: ${{ fromJSON(inputs.pio-environment-list) }} - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Run 'pio check' - working-directory: ${{ inputs.pio-ini-location }} - run: pio check -e ${{ matrix.environment }} diff --git a/.github/workflows/platformio_publish_template.yml b/.github/workflows/platformio_publish_template.yml deleted file mode 100644 index fdea098..0000000 --- a/.github/workflows/platformio_publish_template.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: PlatformIO Publish - -on: - workflow_call: - inputs: - pkg-owner: - type: string - description: The user/org that will be the owner of the published package - default: "sensirion" - should-publish: - type: boolean - description: Should the package be published to the registry - default: false - secrets: - pio-registry-token: - description: PlatformIO Token used to login - required: false - -jobs: - platformio-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - name: Recreate tmp folder - run: | - if [ -d ./tmp/ ]; then rm -Rf ./tmp/; fi - mkdir ./tmp/ - - name: Select relevant resource to package - run: | - cp -r examples tmp - cp -r src tmp - cp -r py_scripts tmp - cp CHANGELOG.md tmp - cp library.properties tmp - cp LICENSE tmp - cp platformio.ini tmp - cp README.md tmp - - name: Create library package - run: pio pkg pack tmp - - name: Upload package archive - uses: actions/upload-artifact@v4 - with: - name: pio-library-archive - path: ./*.tar.gz - retention-days: 2 - - name: Login into PlatformIO - if: ${{ inputs.should-publish }} - run: pio account login - env: - PLATFORMIO_AUTH_TOKEN: ${{ secrets.pio-registry-token }} - - name: Run 'pio pkg publish' - if: ${{ inputs.should-publish }} - run: pio pkg publish --owner ${{ inputs.pkg-owner }} --no-interactive ./*.tar.gz From 4f011366993b5f1ab2fd79f052aba78cb9ea3bbf Mon Sep 17 00:00:00 2001 From: Quentin Fisch Date: Tue, 27 Feb 2024 14:00:39 +0100 Subject: [PATCH 2/2] Added arduino CI workflow --- .github/workflows/arduino.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/arduino.yml diff --git a/.github/workflows/arduino.yml b/.github/workflows/arduino.yml new file mode 100644 index 0000000..24281e4 --- /dev/null +++ b/.github/workflows/arduino.yml @@ -0,0 +1,26 @@ +name: Arduino Lib + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + arduino-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/arduino-lint-action@v1 + with: + library-manager: update + + arduino-ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: Arduino-CI/action@stable-1.x + env: + EXPECT_EXAMPLES: true