mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-01 22:37:03 +00:00
* ci: build the Windows x64 dependencies and slicer with clang-cl Passes -l -x from the Windows jobs, using the clang-cl and Ninja options added in #15373. Ninja runs each dependency's build step as a plain command, so the jobs set up a VC environment for OpenSSL's nmake. arm64 stays on MSVC for now. The deps cache key gains the compiler, so windows-x64 becomes windows-x64-clang and windows-arm64 becomes windows-arm64-msvc. * deps: select OpenSSL's ARM64 target from DEPS_ARCH CMAKE_GENERATOR_PLATFORM is only set by -A, which Ninja never receives, so the Ninja build selected the x64 target on ARM64. DEPS_ARCH is derived from CMAKE_SYSTEM_PROCESSOR and is already independent of the generator. * ci: build the Windows ARM64 dependencies and slicer with clang-cl Three dependencies need handling first. libpng and OpenCV each build an ARM SIMD path that does not compile with clang-cl, so those paths are off; PNG already had the same opt-out for Apple ARM. OCCT is built with cl, since clang-cl cannot emit one of its large generated files and there is no option to turn that off. All three are gated to Windows ARM64 with clang.
310 lines
12 KiB
YAML
310 lines
12 KiB
YAML
name: Build all
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- release/*
|
|
- belt-printer
|
|
paths:
|
|
- 'deps/**'
|
|
- 'src/**'
|
|
- '**/CMakeLists.txt'
|
|
- 'version.inc'
|
|
- 'localization/**'
|
|
- 'resources/**'
|
|
- ".github/workflows/build_*.yml"
|
|
- 'scripts/build_preset_cache.*'
|
|
- 'scripts/flatpak/**'
|
|
- 'scripts/msix/**'
|
|
- 'tests/**'
|
|
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- release/*
|
|
paths:
|
|
- 'deps/**'
|
|
- 'deps_src/**'
|
|
- 'src/**'
|
|
- '**/CMakeLists.txt'
|
|
- 'version.inc'
|
|
- ".github/workflows/build_*.yml"
|
|
- 'build_linux.sh'
|
|
- 'build_release_vs.bat'
|
|
- 'build_release_vs2022.bat'
|
|
- 'build_release_macos.sh'
|
|
- 'scripts/build_preset_cache.*'
|
|
- 'scripts/flatpak/**'
|
|
- 'scripts/msix/**'
|
|
- 'tests/**'
|
|
|
|
|
|
schedule:
|
|
- cron: '0 17 * * *' # run once a day at 1 AM Singapore time (UTC+8)
|
|
|
|
workflow_dispatch: # allows for manual dispatch
|
|
inputs:
|
|
build-deps-only:
|
|
description: 'Only build dependencies (bypasses caching)'
|
|
type: boolean
|
|
default: false
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
|
|
jobs:
|
|
build_linux:
|
|
strategy:
|
|
fail-fast: false
|
|
# SELF_HOSTED skips arm64 (no arm self-hosted server). amd64's empty arch
|
|
# is load-bearing: it keeps the historical 'linux-clang' deps cache key and
|
|
# the unsuffixed asset names.
|
|
matrix:
|
|
include: ${{ fromJSON(vars.SELF_HOSTED
|
|
&& '[{"arch":"","os":"orca-lnx-server"}]'
|
|
|| '[{"arch":"","os":"ubuntu-24.04"},{"arch":"aarch64","os":"ubuntu-24.04-arm"}]') }}
|
|
# Don't run scheduled builds on forks:
|
|
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
|
uses: ./.github/workflows/build_check_cache.yml
|
|
with:
|
|
os: ${{ matrix.os }}
|
|
arch: ${{ matrix.arch }}
|
|
build-deps-only: ${{ inputs.build-deps-only || false }}
|
|
secrets: inherit
|
|
build_windows:
|
|
name: Build Windows ${{ matrix.arch }}
|
|
strategy:
|
|
fail-fast: false
|
|
# SELF_HOSTED skips arm64 (the self-hosted Windows server is x64-only).
|
|
matrix:
|
|
include: ${{ fromJSON(vars.SELF_HOSTED
|
|
&& '[{"arch":"x64","os":"orca-win-server","compiler":"clang"}]'
|
|
|| '[{"arch":"x64","os":"windows-latest","compiler":"clang"},{"arch":"arm64","os":"windows-11-arm","compiler":"clang"}]') }}
|
|
# Don't run scheduled builds on forks:
|
|
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
|
uses: ./.github/workflows/build_check_cache.yml
|
|
with:
|
|
os: ${{ matrix.os }}
|
|
arch: ${{ matrix.arch }}
|
|
compiler: ${{ matrix.compiler }}
|
|
build-deps-only: ${{ inputs.build-deps-only || false }}
|
|
force-build: ${{ github.event_name == 'schedule' }}
|
|
secrets: inherit
|
|
build_macos_arch:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- arm64
|
|
- x86_64
|
|
# Don't run scheduled builds on forks:
|
|
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
|
uses: ./.github/workflows/build_check_cache.yml
|
|
with:
|
|
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
|
arch: ${{ matrix.arch }}
|
|
build-deps-only: ${{ inputs.build-deps-only || false }}
|
|
force-build: ${{ github.event_name == 'schedule' }}
|
|
secrets: inherit
|
|
build_macos_universal:
|
|
name: Build macOS Universal
|
|
needs: build_macos_arch
|
|
if: ${{ !cancelled() && needs.build_macos_arch.result == 'success' && !inputs.build-deps-only && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
|
uses: ./.github/workflows/build_orca.yml
|
|
with:
|
|
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
|
arch: universal
|
|
macos-combine-only: true
|
|
secrets: inherit
|
|
# One test job per built arch, on the runner that built it.
|
|
unit_tests_linux_x86_64:
|
|
name: Linux x86_64
|
|
needs: build_linux
|
|
if: ${{ !cancelled() && success() }}
|
|
uses: ./.github/workflows/unit_tests.yml
|
|
with:
|
|
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
|
|
artifact: ${{ github.sha }}-tests-linux-x86_64
|
|
unit_tests_linux_aarch64:
|
|
name: Linux aarch64
|
|
needs: build_linux
|
|
if: ${{ !cancelled() && success() && !vars.SELF_HOSTED }}
|
|
uses: ./.github/workflows/unit_tests.yml
|
|
with:
|
|
os: ubuntu-24.04-arm
|
|
artifact: ${{ github.sha }}-tests-linux-aarch64
|
|
unit_tests_windows_x64:
|
|
name: Windows x64
|
|
needs: build_windows
|
|
if: ${{ !cancelled() && success() }}
|
|
uses: ./.github/workflows/unit_tests.yml
|
|
with:
|
|
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
|
|
artifact: ${{ github.sha }}-tests-windows-x64
|
|
unit_tests_windows_arm64:
|
|
name: Windows arm64
|
|
needs: build_windows
|
|
if: ${{ !cancelled() && success() && !vars.SELF_HOSTED }}
|
|
uses: ./.github/workflows/unit_tests.yml
|
|
with:
|
|
os: windows-11-arm
|
|
artifact: ${{ github.sha }}-tests-windows-arm64
|
|
test-dir: build-arm64/tests
|
|
unit_tests_macos_arm64:
|
|
name: macOS arm64
|
|
needs: build_macos_arch
|
|
if: ${{ !cancelled() && success() }}
|
|
uses: ./.github/workflows/unit_tests.yml
|
|
with:
|
|
os: ${{ vars.SELF_HOSTED && 'orca-macos-arm64' || 'macos-14' }}
|
|
artifact: ${{ github.sha }}-tests-macos-arm64
|
|
test-dir: build/arm64/tests
|
|
# Slice a two-colour cube through every shipped printer so all custom g-code
|
|
# (change_filament_gcode, machine start/end, etc.) is expanded - catches
|
|
# slicing regressions the static profile checks and unit tests can't see.
|
|
# Profile-only PRs are covered by check_profiles.yml's nightly binary; this
|
|
# covers src/engine PRs with the PR-built binary.
|
|
slice_check_linux:
|
|
name: Slice check (Linux ${{ vars.SELF_HOSTED && 'x86_64' || 'aarch64' }})
|
|
needs: build_linux
|
|
if: ${{ !cancelled() && success() }}
|
|
# Follows whichever Linux leg built the validator.
|
|
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04-arm' }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
- name: Download profile validator
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: ${{ github.sha }}-profile-validator-linux-${{ vars.SELF_HOSTED && 'x86_64' || 'aarch64' }}
|
|
path: validator-bin
|
|
- name: Validate slice (expand custom g-code)
|
|
timeout-minutes: 60
|
|
run: |
|
|
chmod +x validator-bin/OrcaSlicer_profile_validator
|
|
./validator-bin/OrcaSlicer_profile_validator -p "${{ github.workspace }}/resources/profiles" -s -l 2
|
|
publish_test_results:
|
|
name: Publish Test Results
|
|
needs: [unit_tests_linux_x86_64, unit_tests_linux_aarch64, unit_tests_windows_x64, unit_tests_windows_arm64, unit_tests_macos_arm64]
|
|
if: ${{ !cancelled() }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Download Test Results
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
pattern: test-results-*
|
|
path: test-results
|
|
# Best-effort: a read-only token (e.g. fork PRs) can't write the check, so
|
|
# don't let a publish failure fail the run. The test jobs gate correctness.
|
|
- name: Publish Test Results
|
|
continue-on-error: true
|
|
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
with:
|
|
files: "test-results/**/*.xml"
|
|
- name: Delete Test Results
|
|
if: success()
|
|
uses: geekyeggo/delete-artifact@v6
|
|
with:
|
|
name: test-results-*
|
|
failOnError: false
|
|
flatpak:
|
|
name: "Flatpak"
|
|
container:
|
|
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
|
|
options: --privileged
|
|
volumes:
|
|
- /usr/local/lib/android:/usr/local/lib/android
|
|
- /usr/share/dotnet:/usr/share/dotnet
|
|
- /opt/ghc:/opt/ghc1
|
|
- /usr/local/share/boost:/usr/local/share/boost1
|
|
- /opt/hostedtoolcache:/opt/hostedtoolcache1
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant:
|
|
- arch: x86_64
|
|
runner: ubuntu-24.04
|
|
- arch: aarch64
|
|
runner: ubuntu-24.04-arm
|
|
# Don't run scheduled builds on forks; skip entirely on self-hosted runners
|
|
if: ${{ !cancelled() && !vars.SELF_HOSTED && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
|
|
|
runs-on: ${{ matrix.variant.runner }}
|
|
env:
|
|
date:
|
|
ver:
|
|
ver_pure:
|
|
# Belt-printer nightlies share the main nightly release but carry a `_belt`
|
|
# suffix so they never overwrite the main assets.
|
|
nightly_suffix: ${{ github.ref == 'refs/heads/belt-printer' && '_belt' || '' }}
|
|
steps:
|
|
- name: "Remove unneeded stuff to free disk space"
|
|
run:
|
|
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*" /opt/hostedtoolcache1/*
|
|
- uses: actions/checkout@v7
|
|
- name: Get the version and date
|
|
run: |
|
|
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
|
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
|
ver="PR-${{ github.event.number }}"
|
|
git_commit_hash="${{ github.event.pull_request.head.sha }}"
|
|
else
|
|
ver=V$ver_pure
|
|
git_commit_hash="${{ github.sha }}"
|
|
fi
|
|
echo "ver=$ver" >> $GITHUB_ENV
|
|
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
|
|
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
|
echo "git_commit_hash=$git_commit_hash" >> $GITHUB_ENV
|
|
shell: bash
|
|
# Manage flatpak-builder cache externally so PRs restore but never upload
|
|
- name: Restore flatpak-builder cache
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/cache/restore@v6
|
|
with:
|
|
path: .flatpak-builder
|
|
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.event.pull_request.base.sha }}
|
|
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
|
- name: Save/restore flatpak-builder cache
|
|
if: github.event_name != 'pull_request'
|
|
uses: actions/cache@v6
|
|
with:
|
|
path: .flatpak-builder
|
|
key: flatpak-builder-${{ matrix.variant.arch }}-${{ github.sha }}
|
|
restore-keys: flatpak-builder-${{ matrix.variant.arch }}-
|
|
- name: Disable debug info for faster CI builds
|
|
run: |
|
|
sed -i '/^build-options:/a\ no-debuginfo: true\n strip: true' \
|
|
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
|
shell: bash
|
|
- name: Inject git commit hash into Flatpak manifest
|
|
run: |
|
|
sed -i "/name: OrcaSlicer/{n;s|buildsystem: simple|buildsystem: simple\n build-options:\n env:\n git_commit_hash: \"$git_commit_hash\"|}" \
|
|
scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
|
shell: bash
|
|
- uses: flatpak/flatpak-github-actions/flatpak-builder@master
|
|
with:
|
|
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
|
manifest-path: scripts/flatpak/com.orcaslicer.OrcaSlicer.yml
|
|
cache: false
|
|
arch: ${{ matrix.variant.arch }}
|
|
upload-artifact: false
|
|
- name: Upload artifacts Flatpak
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
|
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
|
|
- name: Deploy Flatpak to nightly release
|
|
if: github.repository == 'OrcaSlicer/OrcaSlicer' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/belt-printer')
|
|
uses: WebFreak001/deploy-nightly@v3.2.0
|
|
with:
|
|
upload_url: https://uploads.github.com/repos/OrcaSlicer/OrcaSlicer/releases/137995723/assets{?name,label}
|
|
release_id: 137995723
|
|
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
|
|
asset_name: OrcaSlicer-Linux-flatpak_nightly${{ env.nightly_suffix }}_${{ matrix.variant.arch }}.flatpak
|
|
asset_content_type: application/octet-stream
|
|
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
|