Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
on:
workflow_call:
jobs:
linux:
name: ${{ matrix.name }}
runs-on: ubuntu-24.04
container: ${{ matrix.image }}
env:
OS: 'linux'
ARCH: 'x86_64'
CARGO_INCREMENTAL: 0 # Avoid creating additional build artifacts
CCACHE_MAXSIZE: '1G'
CCACHE_DIR: ${{ github.workspace }}/.ccache
CARGO_HOME: ${{ github.workspace }}/.cargo
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CMAKE_OPTIONS: ${{ matrix.cmake_options }}
strategy:
matrix:
include:
- name: Ubuntu 22.04 Qt6.10 GCC
image: librepcb/librepcb-dev:ubuntu-22.04-qt6.10-1
- name: Ubuntu 24.04 Clang
image: librepcb/librepcb-dev:ubuntu-24.04-4
cc: clang
cxx: clang++
cmake_options: '-DCMAKE_CXX_FLAGS="-DQT_FORCE_ASSERTS=1"'
ld_library_path: ${{ github.workspace }}/build/install/lib
- name: Ubuntu 26.04 Unbundled
image: librepcb/librepcb-dev:ubuntu-26.04-1
cmake_options: '-DCMAKE_CXX_FLAGS="-DQT_FORCE_ASSERTS=1"'
ld_library_path: ${{ github.workspace }}/build/install/lib
unbundle: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# https://github.com/actions/checkout/issues/1048
- name: Fix Git Permissions
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- 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/
# <--- caching
- name: Install Dependencies
run: ./ci/install_dependencies.sh
env:
SLINT_UI_TESTING_AUTH: ${{ secrets.SLINT_UI_TESTING_AUTH }}
- name: Print New Environment
run: ./ci/print_environment.sh
- name: Unbundle Libraries
run: |
rm -r libs/dxflib
rm -r libs/googletest
rm -r libs/muparser
rm -r libs/polyclipping
if: ${{ matrix.unbundle && (!cancelled()) }}
- id: build
name: Build LibrePCB
run: ./ci/build_librepcb.sh
env:
LIBREPCB_BUILD_AUTHOR: "LibrePCB CI"
- name: Build Portable Packages
run: ./ci/build_linux_portables.sh
if: ${{ (steps.build.outcome == 'success') && (matrix.deploy == 'true') && (!cancelled()) }}
- name: Run rust-core Tests
run: cd libs/librepcb/rust-core && cargo test --features=fail-on-warnings
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Unittests
run: xvfb-run -a ./build/tests/unittests/librepcb-unittests
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB-CLI Functional Tests
run: xvfb-run -a --server-args="-screen 0 1024x768x24" uv --directory ./tests/cli run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/librepcb-cli"
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Functional Tests
run: xvfb-run -a --server-args="-screen 0 1024x768x24" uv --directory ./tests/funq run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/librepcb" --reruns 5 --reruns-delay 10
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB UI Tests
run: xvfb-run -a --server-args="-screen 0 1600x1200x24" uv --directory "./tests/ui" run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/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') && (matrix.deploy == 'true') && (!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
94ec4b8feThis file is pinned to the selected release. Download the original to open it in your design tool.