From a030a2d06787ef81c601e9f940f3d78ab7633743 Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sat, 27 Apr 2024 15:42:07 +0200 Subject: [PATCH 1/2] Add separate x64 build --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09e27045ca..4ff42bfa93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,6 +109,42 @@ jobs: name: ${{ env.BUILD_NAME }}_SITL-MacOS path: ./build_SITL/*_SITL + build-SITL-Mac-large: + runs-on: macos-latest-large + steps: + - uses: actions/checkout@v3 + - name: Install dependencies + run: | + brew install cmake ninja ruby + + - name: Setup environment + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + run: | + # This is the hash of the commit for the PR + # when the action is triggered by PR, empty otherwise + COMMIT_ID=${{ github.event.pull_request.head.sha }} + # This is the hash of the commit when triggered by push + # but the hash of refs/pull//merge, which is different + # from the hash of the latest commit in the PR, that's + # why we try github.event.pull_request.head.sha first + COMMIT_ID=${COMMIT_ID:-${{ github.sha }}} + BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID}) + VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }') + echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV + echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV + - name: Build SITL + run: | + mkdir -p build_SITL && cd build_SITL + cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. + ninja + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ env.BUILD_NAME }}_SITL-MacOS-x64 + path: ./build_SITL/*_SITL + build-SITL-Windows: runs-on: windows-latest defaults: From f6a86f80f978c24c7e5bcca5c21c63091d3166ef Mon Sep 17 00:00:00 2001 From: Marcelo Bezerra <23555060+mmosca@users.noreply.github.com> Date: Sat, 27 Apr 2024 15:47:06 +0200 Subject: [PATCH 2/2] Build MacOSX sitl as universal binary --- .github/workflows/ci.yml | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ff42bfa93..111a0cc35c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: - name: Build SITL run: | mkdir -p build_SITL && cd build_SITL - cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. + cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -G Ninja .. ninja - name: Upload artifacts @@ -109,42 +109,6 @@ jobs: name: ${{ env.BUILD_NAME }}_SITL-MacOS path: ./build_SITL/*_SITL - build-SITL-Mac-large: - runs-on: macos-latest-large - steps: - - uses: actions/checkout@v3 - - name: Install dependencies - run: | - brew install cmake ninja ruby - - - name: Setup environment - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - run: | - # This is the hash of the commit for the PR - # when the action is triggered by PR, empty otherwise - COMMIT_ID=${{ github.event.pull_request.head.sha }} - # This is the hash of the commit when triggered by push - # but the hash of refs/pull//merge, which is different - # from the hash of the latest commit in the PR, that's - # why we try github.event.pull_request.head.sha first - COMMIT_ID=${COMMIT_ID:-${{ github.sha }}} - BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID}) - VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }') - echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV - echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV - - name: Build SITL - run: | - mkdir -p build_SITL && cd build_SITL - cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. - ninja - - - name: Upload artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ env.BUILD_NAME }}_SITL-MacOS-x64 - path: ./build_SITL/*_SITL - build-SITL-Windows: runs-on: windows-latest defaults: