From dbe4d894c04a1c4cdbbdc5ee2711c0b53b328970 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 4 Oct 2022 13:21:26 +0200 Subject: [PATCH 1/8] =?UTF-8?q?ci:=20=E2=9C=A8=20Add=20Rasberry=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry.yml | 153 ++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 .github/workflows/raspberry.yml diff --git a/.github/workflows/raspberry.yml b/.github/workflows/raspberry.yml new file mode 100644 index 00000000..24856bfc --- /dev/null +++ b/.github/workflows/raspberry.yml @@ -0,0 +1,153 @@ +name: Rasberry Pi + +on: + pull_request: + branches: + - master + push: + workflow_dispatch: + workflow_call: + inputs: + target: + required: true + type: string + arch: + required: false + default: "" + type: string + +env: + CARGO_TERM_COLOR: always + +jobs: + publish-release: + if: github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: ["espflash", "cargo-espflash"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ inputs.target }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Replace target string + uses: mad9000/actions-find-and-replace-string@1 + id: findandreplace + with: + source: ${{ inputs.target }} + find: "unknown-" + replace: "" + - name: Build dependencies + run: | + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt-get update + echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list + sudo apt update + sudo dpkg --add-architecture ${{ inputs.arch }} + sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ inputs.arch }}" "libgcc-s1:${{ inputs.arch }}" "libc6:${{ inputs.arch }}" "libudev-dev:${{ inputs.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu + echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV + echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV + echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + if [[ ${{ inputs.arch }} == arm64 ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV + fi + if [[ ${{ inputs.arch }} == armhf ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV + fi + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all --target ${{ inputs.target }} --features=raspberry + - name: Compress + run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} + - uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.crate }}-${{ inputs.target }}.zip + tag: ${{ github.ref }} + + rust-ci: + if: github.event_name != 'workflow_dispatch' + name: "Rust CI: ${{ matrix.job.name }} - ${{ matrix.board.target }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + - target: armv7-unknown-linux-gnueabihf + arch: armhf + - target: aarch64-unknown-linux-gnu + arch: arm64 + job: + - name: Check + toolchain: stable + cargo-command: check + - name: Check MSRV + toolchain: "1.60" + cargo-command: check + - name: Unit Test + toolchain: stable + cargo-command: test + args: --lib + - name: Rustfmt + toolchain: stable + components: rustfmt + cargo-command: fmt + args: --all -- --check + - name: Clippy + toolchain: stable + components: clippy + cargo-command: clippy + args: -- -A clippy::too_many_arguments + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.job.toolchain }} + target: ${{ matrix.board.target }} + components: ${{ matrix.job.components }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Replace target string + uses: mad9000/actions-find-and-replace-string@1 + id: findandreplace + with: + source: ${{ matrix.board.target }} + find: "unknown-" + replace: "" + - name: Build dependencies + if: matrix.job.cargo-command != 'fmt' + run: | + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt-get update + echo "deb [arch=${{ matrix.board.arch }} http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=${{ matrix.board.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list + sudo apt update + sudo dpkg --add-architecture ${{ matrix.board.arch }} + sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ matrix.board.arch }}" "libgcc-s1:${{ matrix.board.arch }}" "libc6:${{ matrix.board.arch }}" "libudev-dev:${{ matrix.board.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu + echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV + echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV + echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + if [[ ${{ matrix.board.arch }} == arm64 ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV + fi + if [[ ${{ matrix.board.arch }} == armhf ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV + fi + - uses: actions-rs/cargo@v1 + with: + command: ${{ matrix.job.cargo-command }} + args: ${{ matrix.job.args }} --features=raspberry From a89b6f48b56cc205bc12483d21ff30151d4c5061 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 4 Oct 2022 13:24:50 +0200 Subject: [PATCH 2/8] =?UTF-8?q?ci:=20=F0=9F=90=9B=20Fix=20typo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/raspberry.yml b/.github/workflows/raspberry.yml index 24856bfc..8a0392a9 100644 --- a/.github/workflows/raspberry.yml +++ b/.github/workflows/raspberry.yml @@ -130,7 +130,7 @@ jobs: run: | sudo sed -i 's/azure\.//' /etc/apt/sources.list sudo apt-get update - echo "deb [arch=${{ matrix.board.arch }} http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=${{ matrix.board.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list echo "deb [arch=${{ matrix.board.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list sudo apt update sudo dpkg --add-architecture ${{ matrix.board.arch }} From a21b484bc07b4fadbd409d7515b5b53b68c9ea9b Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 4 Oct 2022 13:30:44 +0200 Subject: [PATCH 3/8] =?UTF-8?q?ci:=20=F0=9F=90=9B=20Fix=20args=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/raspberry.yml b/.github/workflows/raspberry.yml index 8a0392a9..6a3045c6 100644 --- a/.github/workflows/raspberry.yml +++ b/.github/workflows/raspberry.yml @@ -150,4 +150,4 @@ jobs: - uses: actions-rs/cargo@v1 with: command: ${{ matrix.job.cargo-command }} - args: ${{ matrix.job.args }} --features=raspberry + args: --features=raspberry ${{ matrix.job.args }} From 8580fa0ddd309b9a2ef49f95d42985dc7c9a4b42 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 4 Oct 2022 13:34:18 +0200 Subject: [PATCH 4/8] =?UTF-8?q?ci:=20=F0=9F=90=9B=20Fix=20args=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/raspberry.yml b/.github/workflows/raspberry.yml index 6a3045c6..2466684c 100644 --- a/.github/workflows/raspberry.yml +++ b/.github/workflows/raspberry.yml @@ -91,13 +91,15 @@ jobs: - name: Check toolchain: stable cargo-command: check + args: --features=raspberry - name: Check MSRV toolchain: "1.60" cargo-command: check + args: --features=raspberry - name: Unit Test toolchain: stable cargo-command: test - args: --lib + args: --lib --features=raspberry - name: Rustfmt toolchain: stable components: rustfmt @@ -150,4 +152,4 @@ jobs: - uses: actions-rs/cargo@v1 with: command: ${{ matrix.job.cargo-command }} - args: --features=raspberry ${{ matrix.job.args }} + args: ${{ matrix.job.args }} From d6d292f13a6608d3ca155e77d7fd2a806f4440c0 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Tue, 4 Oct 2022 16:46:07 +0200 Subject: [PATCH 5/8] =?UTF-8?q?chore:=20=E2=9A=A1=EF=B8=8F=20Split=20Raspb?= =?UTF-8?q?erry=20CI=20into=20a=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/package.yml | 45 +---------------------------------- .github/workflows/release.yml | 6 ++--- 2 files changed, 3 insertions(+), 48 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 06d328b2..eb776507 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -13,10 +13,6 @@ on: required: false default: "" type: string - arch: - required: false - default: "" - type: string env: CARGO_TERM_COLOR: always @@ -40,57 +36,18 @@ jobs: - uses: Swatinem/rust-cache@v1 - - name: Replace target string - if: inputs.arch != '' - uses: mad9000/actions-find-and-replace-string@1 - id: findandreplace - with: - source: ${{ inputs.target }} - find: "unknown-" - replace: "" - - - name: Build dependencies raspberry targets - if: inputs.runs_on == 'ubuntu-latest' && inputs.arch != '' - run: | - sudo sed -i 's/azure\.//' /etc/apt/sources.list - sudo apt-get update - echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list - sudo apt update - sudo dpkg --add-architecture ${{ inputs.arch }} - sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ inputs.arch }}" "libgcc-s1:${{ inputs.arch }}" "libc6:${{ inputs.arch }}" "libudev-dev:${{ inputs.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu - echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV - echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV - echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - if [[ ${{ inputs.arch }} == arm64 ]]; then - echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV - fi - if [[ ${{ inputs.arch }} == armhf ]]; then - echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV - echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV - fi - - name: Build dependencies for other ubuntu targets - if: inputs.runs_on == 'ubuntu-latest' && inputs.arch == '' + if: inputs.runs_on == 'ubuntu-latest' run: | sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list sudo apt-get update sudo apt-get install musl-tools libudev-dev - uses: actions-rs/cargo@v1 - if: ${{ inputs.arch == '' }} with: command: build args: --release --all --target ${{ inputs.target }} - - uses: actions-rs/cargo@v1 - if: ${{ inputs.arch != '' }} - with: - command: build - args: --release --all --target ${{ inputs.target }} --features=raspberry - - name: Compress (Unix) if: ${{ inputs.runs_on != 'windows-latest' }} run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb71cbaa..9ff7663c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,16 +8,14 @@ jobs: # Linux armv7-unknown-linux-gnueabihf: - uses: ./.github/workflows/package.yml + uses: ./.github/workflows/raspberry.yml with: - runs_on: ubuntu-latest target: armv7-unknown-linux-gnueabihf arch: armhf aarch64-unknown-linux-gnu: - uses: ./.github/workflows/package.yml + uses: ./.github/workflows/raspberry.yml with: - runs_on: ubuntu-latest target: aarch64-unknown-linux-gnu arch: arm64 From cac7355bd4fe79a1f6b75334a2dd2d12f24b5f41 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 5 Oct 2022 09:09:53 +0200 Subject: [PATCH 6/8] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20Split=20Ra?= =?UTF-8?q?spberry=20CI=20files=20into=20CI=20and=20Package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/package.yml | 8 --- .github/workflows/raspberry_package.yml | 70 +++++++++++++++++++ .../{raspberry.yml => raspberry_rust.yml} | 67 +----------------- .github/workflows/release.yml | 4 +- .github/workflows/rust.yml | 5 +- 5 files changed, 77 insertions(+), 77 deletions(-) create mode 100644 .github/workflows/raspberry_package.yml rename .github/workflows/{raspberry.yml => raspberry_rust.yml} (54%) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index eb776507..5f4ace8b 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -24,38 +24,30 @@ jobs: fail-fast: false matrix: crate: ["espflash", "cargo-espflash"] - steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 with: toolchain: stable target: ${{ inputs.target }} override: true - - uses: Swatinem/rust-cache@v1 - - name: Build dependencies for other ubuntu targets if: inputs.runs_on == 'ubuntu-latest' run: | sudo sed -i 's/azure.archive.ubuntu.com/archive.ubuntu.com/' /etc/apt/sources.list sudo apt-get update sudo apt-get install musl-tools libudev-dev - - uses: actions-rs/cargo@v1 with: command: build args: --release --all --target ${{ inputs.target }} - - name: Compress (Unix) if: ${{ inputs.runs_on != 'windows-latest' }} run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} - - name: Compress (Windows) if: ${{ inputs.runs_on == 'windows-latest' }} run: Compress-Archive target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} ${{ matrix.crate }}-${{ inputs.target }}.zip - - uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/raspberry_package.yml b/.github/workflows/raspberry_package.yml new file mode 100644 index 00000000..1da02fbe --- /dev/null +++ b/.github/workflows/raspberry_package.yml @@ -0,0 +1,70 @@ +name: Rasberry Pi Package + +on: + workflow_call: + inputs: + target: + required: true + type: string + arch: + required: false + default: "" + type: string + +env: + CARGO_TERM_COLOR: always + +jobs: + publish-release: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: ["espflash", "cargo-espflash"] + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ inputs.target }} + override: true + - uses: Swatinem/rust-cache@v1 + - name: Replace target string + uses: mad9000/actions-find-and-replace-string@1 + id: findandreplace + with: + source: ${{ inputs.target }} + find: "unknown-" + replace: "" + - name: Build dependencies + run: | + sudo sed -i 's/azure\.//' /etc/apt/sources.list + sudo apt-get update + echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list + echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list + sudo apt update + sudo dpkg --add-architecture ${{ inputs.arch }} + sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ inputs.arch }}" "libgcc-s1:${{ inputs.arch }}" "libc6:${{ inputs.arch }}" "libudev-dev:${{ inputs.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu + echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV + echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV + echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + if [[ ${{ inputs.arch }} == arm64 ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV + fi + if [[ ${{ inputs.arch }} == armhf ]]; then + echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV + echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV + fi + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all --target ${{ inputs.target }} --features=raspberry + - name: Compress + run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} + - uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ${{ matrix.crate }}-${{ inputs.target }}.zip + tag: ${{ github.ref }} diff --git a/.github/workflows/raspberry.yml b/.github/workflows/raspberry_rust.yml similarity index 54% rename from .github/workflows/raspberry.yml rename to .github/workflows/raspberry_rust.yml index 2466684c..169b3f98 100644 --- a/.github/workflows/raspberry.yml +++ b/.github/workflows/raspberry_rust.yml @@ -1,4 +1,4 @@ -name: Rasberry Pi +name: Rasberry Pi CI on: pull_request: @@ -6,77 +6,12 @@ on: - master push: workflow_dispatch: - workflow_call: - inputs: - target: - required: true - type: string - arch: - required: false - default: "" - type: string env: CARGO_TERM_COLOR: always jobs: - publish-release: - if: github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - crate: ["espflash", "cargo-espflash"] - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ inputs.target }} - override: true - - uses: Swatinem/rust-cache@v1 - - name: Replace target string - uses: mad9000/actions-find-and-replace-string@1 - id: findandreplace - with: - source: ${{ inputs.target }} - find: "unknown-" - replace: "" - - name: Build dependencies - run: | - sudo sed -i 's/azure\.//' /etc/apt/sources.list - sudo apt-get update - echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list - echo "deb [arch=${{ inputs.arch }}] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list - sudo apt update - sudo dpkg --add-architecture ${{ inputs.arch }} - sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:${{ inputs.arch }}" "libgcc-s1:${{ inputs.arch }}" "libc6:${{ inputs.arch }}" "libudev-dev:${{ inputs.arch }}" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu - echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV - echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV - echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - if [[ ${{ inputs.arch }} == arm64 ]]; then - echo "PKG_CONFIG_PATH=/usr/lib/${{ steps.findandreplace.outputs.value }}/pkgconfig" >> $GITHUB_ENV - echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=${{ steps.findandreplace.outputs.value }}-gcc" >> $GITHUB_ENV - fi - if [[ ${{ inputs.arch }} == armhf ]]; then - echo "PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig" >> $GITHUB_ENV - echo "CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV - fi - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release --all --target ${{ inputs.target }} --features=raspberry - - name: Compress - run: zip -j ${{ matrix.crate }}-${{ inputs.target }}.zip target/${{ inputs.target }}/release/${{ matrix.crate }}${{ inputs.extension }} - - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ matrix.crate }}-${{ inputs.target }}.zip - tag: ${{ github.ref }} - rust-ci: - if: github.event_name != 'workflow_dispatch' name: "Rust CI: ${{ matrix.job.name }} - ${{ matrix.board.target }}" runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ff7663c..b26202ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,13 +8,13 @@ jobs: # Linux armv7-unknown-linux-gnueabihf: - uses: ./.github/workflows/raspberry.yml + uses: ./.github/workflows/raspberry_package.yml with: target: armv7-unknown-linux-gnueabihf arch: armhf aarch64-unknown-linux-gnu: - uses: ./.github/workflows/raspberry.yml + uses: ./.github/workflows/raspberry_package.yml with: target: aarch64-unknown-linux-gnu arch: arm64 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f302c382..684d4146 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,3 +1,5 @@ +name: CI + on: pull_request: branches: @@ -5,7 +7,8 @@ on: push: workflow_dispatch: -name: CI +env: + CARGO_TERM_COLOR: always jobs: check: From 6ce435a3df89957a048e1f006964b22b233fa186 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 5 Oct 2022 09:50:48 +0200 Subject: [PATCH 7/8] =?UTF-8?q?ci:=20=F0=9F=90=9B=20Add=20features=20arg?= =?UTF-8?q?=20to=20clippy=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry_rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/raspberry_rust.yml b/.github/workflows/raspberry_rust.yml index 169b3f98..9a2afa03 100644 --- a/.github/workflows/raspberry_rust.yml +++ b/.github/workflows/raspberry_rust.yml @@ -44,7 +44,7 @@ jobs: toolchain: stable components: clippy cargo-command: clippy - args: -- -A clippy::too_many_arguments + args: --features=raspberry -- -A clippy::too_many_arguments steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 From f98626a55f5ba25be3f8e823d463f8b638c3f57c Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 5 Oct 2022 09:51:07 +0200 Subject: [PATCH 8/8] =?UTF-8?q?ci:=20=E2=9A=A1=EF=B8=8F=20Remove=20fmt=20c?= =?UTF-8?q?heck?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/raspberry_rust.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/raspberry_rust.yml b/.github/workflows/raspberry_rust.yml index 9a2afa03..3931f700 100644 --- a/.github/workflows/raspberry_rust.yml +++ b/.github/workflows/raspberry_rust.yml @@ -35,11 +35,6 @@ jobs: toolchain: stable cargo-command: test args: --lib --features=raspberry - - name: Rustfmt - toolchain: stable - components: rustfmt - cargo-command: fmt - args: --all -- --check - name: Clippy toolchain: stable components: clippy