Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
94ec4b8feThis file is pinned to the selected release. Download the original to open it in your design tool.
on:
workflow_call:
jobs:
macos-arm64:
name: MacOS ARM64
# Make sure the 'runs-on' really refers to an Apple Silicon CPU:
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
runs-on: macos-14
env:
OS: 'mac'
ARCH: 'arm64'
COPYFILE_DISABLE: 1 # Stop creating shit files (https://superuser.com/questions/259703/get-mac-tar-to-stop-putting-filenames-in-tar-archives)
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Might speed up homebrew commands(?)
CARGO_INCREMENTAL: 0 # Avoid creating additional build artifacts
CCACHE_MAXSIZE: '1G'
CCACHE_DIR: '/Users/runner/ccache-dir'
CARGO_HOME: '/Users/runner/cargo-home'
# Qt 6.7.3 is the last version that runs on macOS 11.
QT_URL: 'https://qt.mirror.constant.com/archive/qt/6.7/6.7.3/single/qt-everywhere-src-6.7.3.tar.xz'
QT_SHA256: 'a3f1d257cbb14c6536585ffccf7c203ce7017418e1a0c2ed7c316c20c729c801'
QT_ROOT: '/Users/runner/qt'
OCC_VERSION: '7_9_1'
OCC_ROOT: '/Users/runner/occ'
MACOSX_DEPLOYMENT_TARGET: '11' # Picked up by CMake and Rust
CMAKE_PREFIX_PATH: '/Users/runner/qt/lib/cmake/Qt6:/Users/runner/occ/lib/cmake/opencascade'
CMAKE_XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME: 'YES' # Required for notarizing
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Print Environment
run: ./ci/print_environment.sh
# caching --->
- name: Cache .ccache
uses: actions/cache@v4
with:
key: ${{ github.job }}-${{ github.ref }}
restore-keys: ${{ github.job }}-refs/heads/master
path: ${{ env.CCACHE_DIR }}
- name: Cache .cargo
uses: actions/cache@v4
with:
key: ${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}-${{ github.ref }}
restore-keys: ${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}-refs/heads/master
path: |
${{ env.CARGO_HOME }}/bin/
${{ env.CARGO_HOME }}/registry/index/
${{ env.CARGO_HOME }}/registry/cache/
${{ env.CARGO_HOME }}/git/db/
./build/cargo/
./libs/librepcb/rust-core/target/
- name: Cache Qt
uses: actions/cache@v4
with:
key: qt-${{ env.QT_SHA256 }}-macos-${{ env.MACOSX_DEPLOYMENT_TARGET }}-v6
path: ${{ env.QT_ROOT }}
- name: Cache OpenCascade
uses: actions/cache@v4
with:
key: occ-${{ env.OCC_VERSION }}-macos-${{ env.MACOSX_DEPLOYMENT_TARGET }}-v6
path: ${{ env.OCC_ROOT }}
# <--- caching
- name: Install Dependencies
run: |
source ./ci/install_dependencies.sh
# Pass modified PATH to following steps:
echo "$PATH" > "$GITHUB_PATH"
env:
SLINT_UI_TESTING_AUTH: ${{ secrets.SLINT_UI_TESTING_AUTH }}
- name: Print New Environment
run: ./ci/print_environment.sh
- id: build
name: Build LibrePCB
run: ./ci/build_librepcb.sh
env:
LIBREPCB_BUILD_AUTHOR: "LibrePCB CI"
- name: Build Bundle
run: ./ci/build_mac_bundle.sh
- name: Build DMG
run: ./ci/build_mac_dmg.sh
- name: Run rust-core tests
run: >
cd libs/librepcb/rust-core &&
cargo llvm-cov --features=fail-on-warnings --html &&
cargo llvm-cov report
--fail-uncovered-lines 0
--fail-uncovered-regions 0
--fail-uncovered-functions 0
--show-missing-lines
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Unittests
run: ./build/tests/unittests/librepcb-unittests
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB-CLI Functional Tests
run: uv --directory ./tests/cli run --no-dev pytest -vvv --librepcb-executable="../../build/install/LibrePCB.app/Contents/MacOS/librepcb-cli"
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Functional Tests
run: uv --directory ./tests/funq run --no-dev pytest -vvv --librepcb-executable="../../build/install/LibrePCB.app/Contents/MacOS/librepcb" --reruns 5 --reruns-delay 10
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB UI Tests
run: uv --directory ./tests/ui run --no-dev pytest -vvv --librepcb-executable="../../build/install/LibrePCB.app/Contents/MacOS/librepcb"
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) && env.SLINT_UI_TESTING_AUTH }}
env:
SLINT_UI_TESTING_AUTH: ${{ secrets.SLINT_UI_TESTING_AUTH }}
- name: Tar & Upload Artifacts
run: |
./ci/tar_artifacts.sh
./ci/upload_artifacts.sh
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) && (github.event_name == 'push') && env.UPLOAD_URL }}
env:
CI_BRANCH_NAME: ${{ github.ref }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
UPLOAD_USER: ${{ secrets.UPLOAD_USER }}
UPLOAD_PASS: ${{ secrets.UPLOAD_PASS }}
UPLOAD_SIGN_KEY: ${{ secrets.UPLOAD_SIGN_KEY }}
- name: Upload Test Results
uses: actions/upload-artifact@v7
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
with:
name: ${{ github.job }}
if-no-files-found: ignore
path: |
libs/librepcb/rust-core/target/llvm-cov/html/
tests/ui/screenshot.png