From 2652735ebf05e55eb3a73a13ca37520d8b8b7230 Mon Sep 17 00:00:00 2001 From: smittytone Date: Wed, 29 Nov 2023 12:17:45 +0000 Subject: [PATCH] Add Mac/Docker, Win/WSL Linux native GH Action builds --- .github/workflows/build.yml | 78 ++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93b98b4..6494a76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,29 @@ -on: +on:App push: pull_request: workflow_dispatch: schedule: - cron: '0 18 * * *' - jobs: - Build: - name: Build + build_linux_native: + name: Build on Linux with native tools + runs-on: ubuntu-latest + steps: + - name: Get application code + uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Get Pre-reqs + run: DEBIAN_FRONTEND=noninteractive && sudo apt-get update -qq && sudo apt-get install -yqq gcc-arm-none-eabi binutils-arm-none-eabi build-essential libsecret-1-dev cmake curl git + - name: Build application code + run: cmake -S . -B build && cmake --build build + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: mv-http-demo-linux-native + path: ${{ github.workspace }}/build/app/mv-http-demo.* + build_linux_docker: + name: Build on Linux with Docker runs-on: ubuntu-latest steps: - name: Get application code @@ -15,6 +31,56 @@ jobs: with: submodules: 'recursive' - name: Build Docker image - run: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t microvisor-http-image . + run: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t mv-http-image-lin-dock . - name: Build application code - run: docker run --rm -v $(pwd)/:/home/mvisor/project/ --env BUILD_ONLY=true --name microvisor-http-demo microvisor-http-image + run: docker run --rm -v $(pwd)/:/home/mvisor/project/ --env BUILD_ONLY=true --name mv-http-lin-dock mv-http-image-lin-dock + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: mv-http-demo-linux-docker + path: ${{ github.workspace }}/build/app/mv-http-demo.* + build_win_wsl: + name: Build on Windows with WSL + runs-on: windows-latest + defaults: + run: + shell: wsl-bash {0} + steps: + - name: Get WSL + uses: Vampire/setup-wsl@v2 + with: + distribution: Ubuntu-20.04 + - name: Get application code + uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Get Pre-reqs + run: DEBIAN_FRONTEND=noninteractive && sudo apt-get update -qq && apt-get install -yqq gcc-arm-none-eabi binutils-arm-none-eabi build-essential libsecret-1-dev cmake curl git + - name: Build code + run: cmake -S . -B build && cmake --build build + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: mv-http-demo-win-wsl + path: ${{ github.workspace }}/build/app/mv-http-demo.* + build_mac_docker: + name: Build on macOS with Docker + runs-on: macos-latest + steps: + - name: Get application code + uses: actions/checkout@v3 + with: + submodules: 'recursive' + - name: Get Docker + run: brew install docker + - name: Run Docker + run: colima start + - name: Build docker image + run: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) -t mv-http-image-mac-dock . + - name: Build code + run: docker run --rm -v $(pwd)/:/home/mvisor/project/ --env BUILD_ONLY=true --name mv-http-mac-dock mv-http-image-mac-dock + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: mv-freertos-cmsis-demo-mac-docker + path: ${{ github.workspace }}/build/app/mv-http-demo.*