From 9cca29ce1f11a20d634c62225a51381abdcee014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20M=C3=A4rkle?= Date: Tue, 19 Dec 2023 11:32:57 +0100 Subject: [PATCH] CI -> Enable build flows. --- .github/actions/install-arm-gcc/action.yml | 13 ++++++ .github/workflows/build-carl.yaml | 39 ++++++++++++++++++ .github/workflows/build-edgar.yaml | 47 ++++++++++++++++++++++ .github/workflows/build-lea.yaml | 31 ++++++++++++++ .github/workflows/build.yaml | 18 +++++++++ 5 files changed, 148 insertions(+) create mode 100644 .github/actions/install-arm-gcc/action.yml create mode 100644 .github/workflows/build-carl.yaml create mode 100644 .github/workflows/build-edgar.yaml create mode 100644 .github/workflows/build-lea.yaml diff --git a/.github/actions/install-arm-gcc/action.yml b/.github/actions/install-arm-gcc/action.yml new file mode 100644 index 000000000..4f5d62a40 --- /dev/null +++ b/.github/actions/install-arm-gcc/action.yml @@ -0,0 +1,13 @@ +name: Install ARM GCC +description: Install ARM GCC + +runs: + using: "composite" + steps: + - name: Install GCC for ARM + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y \ + binutils-arm-linux-gnueabihf \ + gcc-arm-linux-gnueabihf diff --git a/.github/workflows/build-carl.yaml b/.github/workflows/build-carl.yaml new file mode 100644 index 000000000..5b853275f --- /dev/null +++ b/.github/workflows/build-carl.yaml @@ -0,0 +1,39 @@ +name: build-carl +on: + workflow_call: # allow this workflow to be called from other workflows + inputs: + runs-on: + default: "['ubuntu-latest']" + required: false + type: string + +jobs: + build-carl: + strategy: + matrix: + package: + - name: opendut-carl + target: + name: linux-x86_64 + triple: x86_64-unknown-linux-gnu + name: "Build ${{ matrix.package.name }}-${{ matrix.package.target.name }}" + runs-on: ${{ fromJson(inputs.runs-on) }} + steps: + - name: Checkout Sources + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - name: Install ARM GCC + uses: ./.github/actions/install-arm-gcc + - name: Rust setup + uses: ./.github/actions/rust-setup + with: + cargo-cross: true + + - name: Build + run: cargo ci opendut-carl build --target=${{ matrix.package.target.triple }} + - name: Upload Artifacts + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: "${{ matrix.package.name }}-${{ matrix.package.target.name }}-${{ github.sha }}" + path: "./target/ci/cross/${{ matrix.package.target.triple }}/release/${{ matrix.package.name }}" + if-no-files-found: error + retention-days: 1 diff --git a/.github/workflows/build-edgar.yaml b/.github/workflows/build-edgar.yaml new file mode 100644 index 000000000..4c234e3a9 --- /dev/null +++ b/.github/workflows/build-edgar.yaml @@ -0,0 +1,47 @@ +name: build-edgar +on: + workflow_call: # allow this workflow to be called from other workflows + inputs: + runs-on: + default: "['ubuntu-latest']" + required: false + type: string + +jobs: + build-edgar: + strategy: + matrix: + package: + - name: opendut-edgar + target: + name: linux-x86_64 + triple: x86_64-unknown-linux-gnu + - name: opendut-edgar + target: + name: linux-armhf + triple: armv7-unknown-linux-gnueabihf + - name: opendut-edgar + target: + name: linux-arm64 + triple: aarch64-unknown-linux-gnu + name: "Build ${{ matrix.package.name }}-${{ matrix.package.target.name }}" + runs-on: ${{ fromJson(inputs.runs-on) }} + steps: + - name: Checkout Sources + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - name: Install ARM GCC + uses: ./.github/actions/install-arm-gcc + - name: Rust setup + uses: ./.github/actions/rust-setup + with: + cargo-cross: true + + - name: Build + run: cargo ci opendut-edgar build --target=${{ matrix.package.target.triple }} + - name: "Upload EDGAR build artifact ${{ matrix.package.name }}-${{ matrix.package.target.name }}" + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: "${{ matrix.package.name }}-${{ matrix.package.target.name }}-${{ github.sha }}" + path: "./target/ci/cross/${{ matrix.package.target.triple }}/release/${{ matrix.package.name }}" + if-no-files-found: error + retention-days: 1 diff --git a/.github/workflows/build-lea.yaml b/.github/workflows/build-lea.yaml new file mode 100644 index 000000000..43fdcbed0 --- /dev/null +++ b/.github/workflows/build-lea.yaml @@ -0,0 +1,31 @@ +name: build-lea +on: + workflow_call: # allow this workflow to be called from other workflows + inputs: + runs-on: + default: "['ubuntu-latest']" + required: false + type: string + +jobs: + build-lea: + name: "Build opendut-lea" + runs-on: ${{ fromJson(inputs.runs-on) }} + steps: + - name: Checkout Sources + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + - name: Rust setup + uses: ./.github/actions/rust-setup + with: + cargo-cross: true + cargo-trunk: true + + - name: Build + run: cargo ci opendut-lea build + - name: "Upload LEA build artifact" + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: "opendut-lea-${{ github.sha }}" + path: "./opendut-lea/dist" + if-no-files-found: error + retention-days: 1 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9b1912c7d..5630e8b8d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,4 +25,22 @@ jobs: test: uses: ./.github/workflows/test.yaml # with: +# runs-on: "${{ vars.OPENDUT_GH_RUNNER_LARGE }}" + + build-carl: + uses: ./.github/workflows/build-carl.yaml + needs: [ test ] +# with: +# runs-on: "${{ vars.OPENDUT_GH_RUNNER_LARGE }}" + + build-edgar: + uses: ./.github/workflows/build-edgar.yaml + needs: [ test ] +# with: +# runs-on: "${{ vars.OPENDUT_GH_RUNNER_LARGE }}" + + build-lea: + uses: ./.github/workflows/build-lea.yaml + needs: [ test ] +# with: # runs-on: "${{ vars.OPENDUT_GH_RUNNER_LARGE }}"