From bfffbdaa4d777446d67c3d967ce2b7d68f9abb50 Mon Sep 17 00:00:00 2001 From: Josua Mayer Date: Thu, 27 Jun 2024 12:35:01 +0200 Subject: [PATCH] add ci using github actions Signed-off-by: Josua Mayer --- .github/workflows/build.yml | 97 +++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000000..257694f0214a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,97 @@ +name: build + +on: + push: + branches: [ "v2024.04-solidrun-a38x" ] + pull_request: + branches: [ "v2024.04-solidrun-a38x" ] + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + fetch_compile_publish: + runs-on: ubuntu-latest + timeout-minutes: 30 + container: + image: debian:bookworm-slim + env: + DEBIAN_FRONTEND: noninteractive + CROSS_COMPILE: arm-linux-gnueabihf- + outputs: + build_tag: ${{ steps.tag_step.outputs.build_tag }} + build_ver: ${{ steps.tag_step.outputs.build_ver }} + + steps: + - name: Install Dependencies + run: | + apt-get update + apt-get upgrade -y + apt-get install -y build-essential crossbuild-essential-armhf git + + - name: Checkout pull-request + uses: actions/checkout@v4 + + - name: Get build tag + id: tag_step + run: | + id -u + id -g + sha=${{ github.sha }} + build_tag=$(date +%Y-%m-%d)_${sha:0:7} + echo "build_tag=$build_tag" >> "$GITHUB_OUTPUT" + echo "build_ver=v2024.04" "$GITHUB_OUTPUT" + + - name: Build SD + shell: bash + run: | + make clearfog_defconfig + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-sd.kwb + + - name: Build eMMC data + shell: bash + run: | + make clearfog_defconfig + ./scripts/config --set-val SYS_MMCSD_RAW_MODE_U_BOOT_DATA_PART_OFFSET 0x1000 + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-emmc.kwb + + - name: Build eMMC boot0 + shell: bash + run: | + make clearfog_defconfig + ./scripts/config --set-val SYS_MMC_ENV_PART 1 + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-emmc-boot0.kwb + + - name: Build eMMC boot1 + shell: bash + run: | + make clearfog_defconfig + ./scripts/config --set-val SYS_MMC_ENV_PART 2 + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-emmc-boot1.kwb + + - name: Build SATA + shell: bash + run: | + make clearfog_sata_defconfig + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-sata.kwb + + - name: Build SPI + shell: bash + run: | + make clearfog_spi_defconfig + make -j$(nproc) + install -v -m644 -D u-boot-with-spl.kwb deploy/u-boot-spi.kwb + + - name: Upload to S3 + uses: shallwefootball/upload-s3-action@v1.3.3 + with: + aws_key_id: ${{ secrets.IMAGES_S3_ACCESS }} + aws_secret_access_key: ${{ secrets.IMAGES_S3_SECRET }} + aws_bucket: ${{ secrets.IMAGES_S3_BUCKET }} + endpoint: ${{ secrets.IMAGES_S3_HOST }} + source_dir: deploy + destination_dir: A38X/U-Boot/${{ steps.tag_step.outputs.build_ver }}/${{ steps.tag_step.outputs.build_tag }}