Merge pull request #2302 from Ruadhri17/uploader-actor #733
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: ci_pipeline | |
# All in one ci pipeline | |
# Note that the jobs system-test_offsite_{abcd} , install-and-use-rpi_m32sd10{abcd} | |
# are there four times and are almost identical. They only differ in a character | |
# a,b,c,d that we use to select a runner. | |
# | |
# TODO: Smoke testing on Azure is disabled, we should check if it works out | |
# with 4 runners in parallel or enable only one | |
on: | |
push: | |
branches: [ main, 'release-*' ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: -D warnings | |
jobs: | |
build-amd64: | |
name: Build for amd64 | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Retrieve MSRV from workspace Cargo.toml | |
id: rust_version | |
uses: SebRollen/[email protected] | |
with: | |
file: Cargo.toml | |
field: "workspace.package.rust-version" | |
- name: Enable toolchain via github action | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ steps.rust_version.outputs.value }} | |
- name: Enable cache | |
# https://github.com/marketplace/actions/rust-cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build packages for amd64 | |
run: bash -x ./ci/build_scripts/build.sh | |
- name: Upload artifacts as zip | |
# https://github.com/marketplace/actions/upload-a-build-artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages-x86_64-unknown-linux-musl | |
path: target/x86_64-unknown-linux-musl/packages/*.deb | |
################################################################################# | |
install-and-use-amd64: | |
name: Install artifacts on amd64 | |
runs-on: ubuntu-20.04 | |
needs: build-amd64 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download release artifacts | |
uses: actions/download-artifact@v3 | |
# https://github.com/marketplace/actions/download-a-build-artifact | |
with: | |
name: packages-x86_64-unknown-linux-musl | |
path: package_unpack | |
- name: Install artifacts on amd64 | |
run: ./ci/installation_scripts/install_for_amd64.sh package_unpack | |
- name: Run tedge help | |
run: tedge --help | |
################################################################################## | |
build-arm-matrix: | |
name: Build for ${{ matrix.target }} | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
# Add only arm targets here as we use a custom strip binary! | |
target: | |
[ | |
aarch64-unknown-linux-gnu, | |
aarch64-unknown-linux-musl, | |
arm-unknown-linux-gnueabihf, | |
armv7-unknown-linux-gnueabihf, | |
armv7-unknown-linux-musleabihf, | |
] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Retrieve MSRV from workspace Cargo.toml | |
id: rust_version | |
uses: SebRollen/[email protected] | |
with: | |
file: Cargo.toml | |
field: "workspace.package.rust-version" | |
- name: Enable toolchain via github action | |
uses: dtolnay/rust-toolchain@master | |
with: | |
target: ${{ matrix.target }} | |
toolchain: ${{ steps.rust_version.outputs.value }} | |
- name: Build for ${{ matrix.target }} | |
run: bash -x ./ci/build_scripts/build.sh ${{ matrix.target }} | |
- name: Upload debian packages as zip | |
# https://github.com/marketplace/actions/upload-a-build-artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages-${{ matrix.target }} | |
path: target/${{ matrix.target }}/packages/*.deb | |
- name: Upload sawtooth publisher as zip | |
# https://github.com/marketplace/actions/upload-a-build-artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sawtooth-publisher_${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/sawtooth-publisher | |
- name: Upload dummy-plugin as zip | |
# https://github.com/marketplace/actions/upload-a-build-artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tedge-dummy-plugin_${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/tedge-dummy-plugin | |
################################################################################# | |
clean-up-rpi-matrix: | |
strategy: | |
matrix: | |
rpi: [ m32sd10a, m32sd10b, m32sd10c, m32sd10d ] | |
runs-on: | |
- self-hosted | |
- Linux | |
- ARM | |
- offsite_${{ matrix.rpi }} | |
needs: build-arm-matrix | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Clean up ${{ matrix.rpi }} | |
run: ./ci/installation_scripts/clean_up_rpi.sh | |
continue-on-error: true | |
################################################################################# | |
install-and-use-rpi-matrix: | |
strategy: | |
matrix: | |
rpi: [ m32sd10a, m32sd10b, m32sd10c, m32sd10d ] | |
runs-on: | |
- self-hosted | |
- Linux | |
- ARM | |
- offsite_${{ matrix.rpi }} | |
needs: clean-up-rpi-matrix | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download release artifacts | |
uses: actions/download-artifact@v3 | |
# https://github.com/marketplace/actions/download-a-build-artifact | |
with: | |
name: packages-armv7-unknown-linux-gnueabihf | |
path: package_unpack | |
- name: Download sawtooth publisher | |
uses: actions/download-artifact@v3 | |
# https://github.com/marketplace/actions/download-a-build-artifact | |
with: | |
name: sawtooth-publisher_armv7-unknown-linux-gnueabihf | |
path: /home/pi/examples | |
- name: Download tedge-dummy-plugin | |
uses: actions/download-artifact@v3 | |
# https://github.com/marketplace/actions/download-a-build-artifact | |
with: | |
name: tedge-dummy-plugin_armv7-unknown-linux-gnueabihf | |
path: /home/pi/tedge-dummy-plugin | |
- name: Install all | |
run: ./ci/installation_scripts/install_for_arm.sh package_unpack | |
- name: Configure Bridge | |
run: ./ci/configure_bridge.sh | |
env: | |
C8YPASS: ${{ secrets.SECRET_C8YPASS }} | |
C8YUSERNAME: ${{ secrets.SECRET_C8YUSERNAME }} | |
C8YTENANT: ${{ secrets.SECRET_C8YTENANT }} | |
C8YDEVICE: ${{ matrix.rpi }} | |
TEBASEDIR: /home/pi/actions-runner/_work/thin-edge.io/thin-edge.io/ | |
EXAMPLEDIR: /home/pi/examples | |
C8YURL: https://thin-edge-io.eu-latest.cumulocity.com | |
IOTHUBNAME: ${{ secrets.IOTHUBNAME }} | |
- name: Run smoke test for Cumulocity | |
run: ./ci/ci_smoke_test_c8y.sh | |
env: | |
C8YPASS: ${{ secrets.SECRET_C8YPASS }} | |
C8YUSERNAME: ${{ secrets.SECRET_C8YUSERNAME }} | |
C8YTENANT: ${{ secrets.SECRET_C8YTENANT }} | |
C8YDEVICE: ${{ matrix.rpi }} | |
TEBASEDIR: /home/pi/actions-runner/_work/thin-edge.io/thin-edge.io/ | |
EXAMPLEDIR: /home/pi/examples | |
C8YURL: https://thin-edge-io.eu-latest.cumulocity.com | |
IOTHUBNAME: ${{ secrets.IOTHUBNAME }} | |
# Run tests for Azure | |
# Enable this, when we have decided about how many runners we use | |
# | |
# - name: Run Smoke Test for Azure | |
# run: ./ci/ci_smoke_test_az.sh | |
# env: | |
# SASKEYQUEUE: ${{ secrets.SASKEYQUEUE }} | |
# SASKEYIOTHUB: ${{ secrets.SASKEYIOTHUB }} | |
# AZUREENDPOINT: ${{ secrets.AZUREENDPOINT }} | |
# AZUREEVENTHUB: ${{ secrets.AZUREEVENTHUB }} | |
# IOTHUBNAME: ${{ secrets.IOTHUBNAME }} |