Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
on:
workflow_call:
jobs:
windows-x64:
name: Windows x86_64
runs-on: windows-2025
env:
# Docker image tag: windowsservercore-ltsc2025-qt6.10-64bit-2
# Using digest for easier verification of the transparent build chain.
# https://github.com/LibrePCB/docker-librepcb-dev/actions/runs/36239904389/job/108398337307
IMAGE_DIGEST: 8304d266deddd8a9aacf01bc77b1f304c0e6e2d4ca939e9b8fdf609c004d414b
LIBREPCB_BUILD_AUTHOR: "LibrePCB CI"
steps:
# Clone Repository
- uses: actions/checkout@v6
with:
submodules: recursive
# Restore Caches
- id: restore_ccache
name: Restore .ccache
uses: actions/cache/restore@v5
with:
key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
ccache-${{ github.job }}-${{ github.ref }}
ccache-${{ github.job }}-refs/heads/master
ccache-${{ github.job }}
path: build/.ccache-dir
- id: restore_cargo
name: Restore .cargo
uses: actions/cache/restore@v5
with:
key: cargo-${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}-${{ github.ref }}-${{ github.run_id }}
restore-keys: |
cargo-${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}-${{ github.ref }}
cargo-${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}-refs/heads/master
cargo-${{ github.job }}-${{ hashFiles('libs/librepcb/**/Cargo.lock') }}
cargo-${{ github.job }}
path: |
./build/.cargo-home/bin/
./build/.cargo-home/registry/index/
./build/.cargo-home/registry/cache/
./build/.cargo-home/git/db/
./build/cargo/
./libs/librepcb/rust-core/target/
# Start Docker Container
# Workaround for spurious job failures due to Docker error.
# https://github.com/actions/runner-images/issues/13729
- name: Start Docker Service
run: |
$dockerState = Get-Service -Name "docker"
if ($dockerState.Status -ne "Running") {
Start-Service -Name "docker"
}
- name: Start Docker Container
run: >
docker run -d -t --name ci -w C:/work
-v ${{ github.workspace }}:C:/work
-e OS="windows"
-e ARCH="x86_64"
-e LIBREPCB_BUILD_AUTHOR="LibrePCB CI"
-e CI_BRANCH_NAME="${{ github.ref }}"
-e CCACHE_DIR="C:/work/build/.ccache-dir"
-e CCACHE_MAXSIZE="500MB"
-e CARGO_HOME="C:/work/build/.cargo-home"
-e CARGO_INCREMENTAL="0"
"ghcr.io/librepcb/docker-librepcb-dev@sha256:${{ env.IMAGE_DIGEST }}"
- name: Print Environment
run: docker exec ci bash ./ci/print_environment.sh
# Install Dependencies
- name: Install Python Packages
run: >
docker exec
-e UV_INDEX_SLINT_PRIVATE_USERNAME="${{ secrets.UV_INDEX_SLINT_PRIVATE_USERNAME }}"
-e UV_INDEX_SLINT_PRIVATE_PASSWORD="${{ secrets.UV_INDEX_SLINT_PRIVATE_PASSWORD }}"
ci bash ./ci/install_python_packages.sh
- name: Print New Environment # Print again since it has been modified
run: docker exec ci bash ./ci/print_environment.sh
# Build
- id: build
name: Build LibrePCB
run: docker exec ci bash ./ci/build_librepcb.sh
- name: Build Archive
run: docker exec ci bash ./ci/build_windows_archive.sh
- name: Build Installer
run: docker exec ci bash ./ci/build_windows_installer.sh
# Test
- name: Run rust-core tests
run: docker exec -w C:/work/libs/librepcb/rust-core ci cargo test --features=fail-on-warnings
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Unittests
run: docker exec ci build\\tests\\unittests\\librepcb-unittests.exe
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB-CLI Functional Tests
run: docker exec ci uv --directory ./tests/cli run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/librepcb-cli.exe"
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB Functional Tests
run: docker exec ci uv --directory ./tests/funq run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/librepcb.exe" --reruns 5 --reruns-delay 10
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Run LibrePCB UI Tests
run: docker exec ci uv --directory ./tests/ui run --no-dev pytest -vvv --librepcb-executable="../../build/install/bin/librepcb.exe"
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) && env.UV_INDEX_SLINT_PRIVATE_PASSWORD }}
env:
UV_INDEX_SLINT_PRIVATE_USERNAME: ${{ secrets.UV_INDEX_SLINT_PRIVATE_USERNAME }}
UV_INDEX_SLINT_PRIVATE_PASSWORD: ${{ secrets.UV_INDEX_SLINT_PRIVATE_PASSWORD }}
# Upload Artifacts
- name: Tar Artifacts
run: docker exec ci bash ./ci/tar_artifacts.sh
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) }}
- name: Upload Artifacts
run: >
docker exec
-e UPLOAD_URL="${{ secrets.UPLOAD_URL }}"
-e UPLOAD_USER="${{ secrets.UPLOAD_USER }}"
-e UPLOAD_PASS="${{ secrets.UPLOAD_PASS }}"
-e UPLOAD_SIGN_KEY="${{ secrets.UPLOAD_SIGN_KEY }}"
ci bash ./ci/upload_artifacts.sh
if: ${{ (steps.build.outcome == 'success') && (!cancelled()) && (github.event_name == 'push') && env.UPLOAD_URL }}
env:
UPLOAD_URL: ${{ secrets.UPLOAD_URL }} # Required to use it in 'if' condition
- 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
# Save Caches
- name: Cache .ccache
uses: actions/cache/save@v5
with:
key: ${{ steps.restore_ccache.outputs.cache-primary-key }}
path: build/.ccache-dir
if: ${{ steps.restore_ccache && (!cancelled()) }}
- name: Cache .cargo
uses: actions/cache/save@v5
with:
key: ${{ steps.restore_cargo.outputs.cache-primary-key }}
path: |
./build/.cargo-home/bin/
./build/.cargo-home/registry/index/
./build/.cargo-home/registry/cache/
./build/.cargo-home/git/db/
./build/cargo/
./libs/librepcb/rust-core/target/
if: ${{ steps.restore_cargo && (!cancelled()) }}
08cd531bbThis file is pinned to the selected release. Download the original to open it in your design tool.