mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
Fix missing force-build, use non-docker publish action, be nice to cache (#11688)
* Fix missing force-build and use non-docker publish action Fixes #11687 Fixes #10404 * Initial deletion of build_check_cache Start to fold functionality into build_deps, but definitely broken. * Tests can be built separately Missed this before * Create artifact for all platforms, fix cache usage Cache is only created on `main` branch. Artifact is used to move files between jobs. The Linux artifact was broken, now it's not. The Mac artifact didn't exist, now it does. The Windows artifact gets a new name and now isn't a zip-within-a-zip. Perhaps this will cause a permissions problem; we will see shortly. * Apparently cannot update env used for `if` mid-stream * Force-build causes a clean deps build * Either build or pull from cache Cache only has final output, not intermediate files. So we either build or use the cache. * Keep dep uploads for 10 days instead It's just the final object outputs, not intermediates, so it's not as large and we can keep it slightly longer.
This commit is contained in:
9
.github/workflows/build_all.yml
vendored
9
.github/workflows/build_all.yml
vendored
@@ -48,16 +48,17 @@ concurrency:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_linux:
|
build_linux: # Separate so unit tests can wait on just Linux builds to complete.
|
||||||
name: Build Linux
|
name: Build Linux
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
# Don't run scheduled builds on forks:
|
# Don't run scheduled builds on forks:
|
||||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||||
uses: ./.github/workflows/build_check_cache.yml
|
uses: ./.github/workflows/build_deps.yml
|
||||||
with:
|
with:
|
||||||
os: ubuntu-24.04
|
os: ubuntu-24.04
|
||||||
build-deps-only: ${{ inputs.build-deps-only || false }}
|
build-deps-only: ${{ inputs.build-deps-only || false }}
|
||||||
|
force-build: ${{ github.event_name == 'schedule' }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
build_all:
|
build_all:
|
||||||
name: Build Non-Linux
|
name: Build Non-Linux
|
||||||
@@ -70,7 +71,7 @@ jobs:
|
|||||||
arch: arm64
|
arch: arm64
|
||||||
# Don't run scheduled builds on forks:
|
# Don't run scheduled builds on forks:
|
||||||
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
if: ${{ !cancelled() && (github.event_name != 'schedule' || github.repository == 'OrcaSlicer/OrcaSlicer') }}
|
||||||
uses: ./.github/workflows/build_check_cache.yml
|
uses: ./.github/workflows/build_deps.yml
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
@@ -112,7 +113,7 @@ jobs:
|
|||||||
path: build/tests/**/*.log
|
path: build/tests/**/*.log
|
||||||
- name: Publish Test Results
|
- name: Publish Test Results
|
||||||
if: always()
|
if: always()
|
||||||
uses: EnricoMi/publish-unit-test-result-action@v2
|
uses: EnricoMi/publish-unit-test-result-action/linux@v2
|
||||||
with:
|
with:
|
||||||
files: "ctest_results.xml"
|
files: "ctest_results.xml"
|
||||||
flatpak:
|
flatpak:
|
||||||
|
|||||||
62
.github/workflows/build_check_cache.yml
vendored
62
.github/workflows/build_check_cache.yml
vendored
@@ -1,62 +0,0 @@
|
|||||||
name: Check Cache
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
os:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
arch:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
build-deps-only:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
force-build:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check_cache: # determines if there is a cache and outputs variables used in caching process
|
|
||||||
name: Check Cache
|
|
||||||
runs-on: ${{ inputs.os }}
|
|
||||||
outputs:
|
|
||||||
cache-key: ${{ steps.set_outputs.outputs.cache-key }}
|
|
||||||
cache-path: ${{ steps.set_outputs.outputs.cache-path }}
|
|
||||||
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
lfs: 'true'
|
|
||||||
|
|
||||||
- name: set outputs
|
|
||||||
id: set_outputs
|
|
||||||
env:
|
|
||||||
dep-folder-name: ${{ inputs.os != 'macos-14' && '/OrcaSlicer_dep' || '' }}
|
|
||||||
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
|
|
||||||
run: |
|
|
||||||
echo cache-key=${{ inputs.os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
|
|
||||||
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }}
|
|
||||||
|
|
||||||
- name: load cache
|
|
||||||
id: cache_deps
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ steps.set_outputs.outputs.cache-path }}
|
|
||||||
key: ${{ steps.set_outputs.outputs.cache-key }}
|
|
||||||
lookup-only: true
|
|
||||||
|
|
||||||
build_deps: # call next step
|
|
||||||
name: Build Deps
|
|
||||||
needs: [check_cache]
|
|
||||||
uses: ./.github/workflows/build_deps.yml
|
|
||||||
with:
|
|
||||||
cache-key: ${{ needs.check_cache.outputs.cache-key }}
|
|
||||||
cache-path: ${{ needs.check_cache.outputs.cache-path }}
|
|
||||||
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
|
|
||||||
os: ${{ inputs.os }}
|
|
||||||
arch: ${{ inputs.arch }}
|
|
||||||
build-deps-only: ${{ inputs.build-deps-only }}
|
|
||||||
force-build: ${{ inputs.force-build }}
|
|
||||||
secrets: inherit
|
|
||||||
93
.github/workflows/build_deps.yml
vendored
93
.github/workflows/build_deps.yml
vendored
@@ -1,15 +1,6 @@
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
cache-key:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
cache-path:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
valid-cache:
|
|
||||||
required: true
|
|
||||||
type: boolean
|
|
||||||
os:
|
os:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@@ -26,55 +17,62 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build_deps:
|
build_deps:
|
||||||
name: Build Deps
|
name: Build Deps
|
||||||
if: ${{ !cancelled() && (inputs.build-deps-only || inputs.force-build || inputs.valid-cache != true) }}
|
|
||||||
runs-on: ${{ inputs.os }}
|
runs-on: ${{ inputs.os }}
|
||||||
|
outputs:
|
||||||
|
artifact-name: ${{ env.ARTIFACT_NAME }}
|
||||||
|
artifact-path: ${{ env.DEPS_PATH }}
|
||||||
env:
|
env:
|
||||||
date:
|
DO_BUILD: ${{ inputs.build-deps-only || inputs.force-build }}
|
||||||
|
DEPS_PATH: ${{ github.workspace }}/deps/build${{ inputs.os != 'macos-14' && '/OrcaSlicer_dep' || '' }}
|
||||||
|
ARTIFACT_NAME: OrcaSlicer_dep_${{ inputs.os }}_${{ inputs.arch }}
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
# Setup the environment
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
lfs: 'true'
|
lfs: 'true'
|
||||||
|
|
||||||
|
# Cached deps are just the final outputs, no intermediate files.
|
||||||
|
# So building XOR cache loading.
|
||||||
|
# We use `lookup-only` to skip pulling cache.
|
||||||
- name: load cached deps
|
- name: load cached deps
|
||||||
uses: actions/cache@v4
|
uses: actions/cache/restore@v4
|
||||||
|
id: cache-load
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.cache-path }}
|
path: ${{ env.DEPS_PATH }}
|
||||||
key: ${{ inputs.cache-key }}
|
key: ${{ inputs.os }}-${{ inputs.arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }}
|
||||||
|
lookup-only: ${{ env.DO_BUILD == 'true' }} # Doing this instead of `if` preserves the outputs of this step
|
||||||
|
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') }}
|
||||||
with:
|
with:
|
||||||
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
|
||||||
|
|
||||||
- name: setup dev on Windows
|
- name: setup dev on Windows
|
||||||
if: inputs.os == 'windows-latest'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
||||||
uses: microsoft/setup-msbuild@v2
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
- name: Get the date on Ubuntu and macOS
|
- name: Get the date on Ubuntu and macOS
|
||||||
if: inputs.os != 'windows-latest'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os != 'windows-latest' }}
|
||||||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Get the date on Windows
|
- name: Get the date on Windows
|
||||||
if: inputs.os == 'windows-latest'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
||||||
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
|
|
||||||
|
|
||||||
# Build Dependencies
|
|
||||||
- name: Build on Windows
|
- name: Build on Windows
|
||||||
if: inputs.os == 'windows-latest'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'windows-latest' }}
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: |
|
run: |
|
||||||
choco install strawberryperl
|
choco install strawberryperl
|
||||||
.\build_release_vs.bat deps
|
.\build_release_vs.bat deps
|
||||||
.\build_release_vs.bat pack
|
|
||||||
cd ${{ github.workspace }}/deps/build
|
|
||||||
|
|
||||||
|
# Windows and Linux don't need to delete any directories, because they only package up deps/build/OrcaSlicer_dep.
|
||||||
|
# But Mac has multiple and we're preserving their directory structure relationship.
|
||||||
|
# So the garbage siblings of OrcaSlicer_dep can be deleted to save artifact and cache space.
|
||||||
- name: Build on Mac ${{ inputs.arch }}
|
- name: Build on Mac ${{ inputs.arch }}
|
||||||
if: inputs.os == 'macos-14'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'macos-14' }}
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: |
|
run: |
|
||||||
brew install automake texinfo libtool
|
brew install automake texinfo libtool
|
||||||
@@ -87,53 +85,40 @@ jobs:
|
|||||||
done
|
done
|
||||||
brew install zstd
|
brew install zstd
|
||||||
|
|
||||||
|
|
||||||
- name: Apt-Install Dependencies
|
- name: Apt-Install Dependencies
|
||||||
if: inputs.os == 'ubuntu-24.04'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && inputs.os == 'ubuntu-24.04' }}
|
||||||
uses: ./.github/actions/apt-install-deps
|
uses: ./.github/actions/apt-install-deps
|
||||||
|
|
||||||
- name: Build on Ubuntu
|
- name: Build on Ubuntu
|
||||||
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
|
if: ${{ !cancelled() && (env.DO_BUILD == 'true' || steps.cache-load.outputs.cache-hit != 'true') && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ${{ github.workspace }}/deps/build/destdir
|
|
||||||
./build_linux.sh -dr
|
./build_linux.sh -dr
|
||||||
cd deps/build
|
|
||||||
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
|
|
||||||
|
|
||||||
|
- name: Upload OrcaSlicer_dep director(ies) for use later
|
||||||
# Upload Artifacts
|
if: ${{ !cancelled() && ! env.ACT}}
|
||||||
# - name: Upload Mac ${{ inputs.arch }} artifacts
|
|
||||||
# if: inputs.os == 'macos-14'
|
|
||||||
# uses: actions/upload-artifact@v5
|
|
||||||
# with:
|
|
||||||
# name: OrcaSlicer_dep_mac_${{ env.date }}
|
|
||||||
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz
|
|
||||||
|
|
||||||
- name: Upload Windows artifacts
|
|
||||||
if: inputs.os == 'windows-latest'
|
|
||||||
uses: actions/upload-artifact@v5
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
name: OrcaSlicer_dep_win64_${{ env.date }}
|
name: ${{ env.ARTIFACT_NAME }}
|
||||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
|
path: ${{ env.DEPS_PATH }}
|
||||||
|
retention-days: 10 # It's not too big, but we don't need it for a very long time.
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload Ubuntu artifacts
|
- name: Save cache from main branch
|
||||||
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
|
if: ${{ !cancelled() && github.ref == 'refs/heads/main' && steps.cache-load.outputs.cache-hit != 'true' }}
|
||||||
env:
|
uses: actions/cache/save@v4
|
||||||
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
|
|
||||||
uses: actions/upload-artifact@v5
|
|
||||||
with:
|
with:
|
||||||
name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }}
|
path: ${{ env.DEPS_PATH }}
|
||||||
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
|
key: ${{ steps.cache-load.outputs.cache-primary-key }}
|
||||||
|
|
||||||
build_orca:
|
build_orca:
|
||||||
name: Build OrcaSlicer
|
name: Build OrcaSlicer
|
||||||
needs: [build_deps]
|
needs: [build_deps]
|
||||||
if: ${{ !cancelled() && !inputs.build-deps-only && (inputs.force-build || (inputs.valid-cache == true && needs.build_deps.result == 'skipped') || (inputs.valid-cache != true && success())) }}
|
if: ${{ !cancelled() && (!inputs.build-deps-only || inputs.force-build) }}
|
||||||
uses: ./.github/workflows/build_orca.yml
|
uses: ./.github/workflows/build_orca.yml
|
||||||
with:
|
with:
|
||||||
cache-key: ${{ inputs.cache-key }}
|
artifact-name: ${{ needs.build_deps.outputs.artifact-name }}
|
||||||
cache-path: ${{ inputs.cache-path }}
|
artifact-path: ${{ needs.build_deps.outputs.artifact-path }}
|
||||||
os: ${{ inputs.os }}
|
os: ${{ inputs.os }}
|
||||||
arch: ${{ inputs.arch }}
|
arch: ${{ inputs.arch }}
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|||||||
13
.github/workflows/build_orca.yml
vendored
13
.github/workflows/build_orca.yml
vendored
@@ -1,10 +1,10 @@
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
cache-key:
|
artifact-name:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
cache-path:
|
artifact-path:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
os:
|
os:
|
||||||
@@ -30,12 +30,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
lfs: 'true'
|
lfs: 'true'
|
||||||
|
|
||||||
- name: load cached deps
|
- name: Download deps artifacts
|
||||||
uses: actions/cache@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ inputs.cache-path }}
|
name: ${{ inputs.artifact-name }}
|
||||||
key: ${{ inputs.cache-key }}
|
path: ${{ inputs.artifact-path }}
|
||||||
fail-on-cache-miss: true
|
|
||||||
|
|
||||||
- uses: lukka/get-cmake@latest
|
- uses: lukka/get-cmake@latest
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function usage() {
|
|||||||
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
|
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
|
||||||
echo " -r: skip RAM and disk checks (low RAM compiling)"
|
echo " -r: skip RAM and disk checks (low RAM compiling)"
|
||||||
echo " -s: build the Orca Slicer (optional)"
|
echo " -s: build the Orca Slicer (optional)"
|
||||||
echo " -t: build tests (optional), requires -s flag"
|
echo " -t: build tests (optional)"
|
||||||
echo " -u: install system dependencies (asks for sudo password; build prerequisite)"
|
echo " -u: install system dependencies (asks for sudo password; build prerequisite)"
|
||||||
echo " -l: use Clang instead of GCC (default: GCC)"
|
echo " -l: use Clang instead of GCC (default: GCC)"
|
||||||
echo " -L: use ld.lld as linker (if available)"
|
echo " -L: use ld.lld as linker (if available)"
|
||||||
|
|||||||
Reference in New Issue
Block a user