-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
62 lines (52 loc) · 2.13 KB
/
build_check_cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Build and Cache Dependencies
on:
push:
branches:
- main # Trigger the workflow on push to the main branch
pull_request:
branches:
- main # Trigger the workflow on pull requests to the main branch
jobs:
build:
runs-on: ubuntu-24.04 # or adjust to your environment
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# Step 2: Set up CMake and Ninja (if necessary)
- name: Set up CMake
uses: lukka/get-cmake@latest
with:
useCloudCache: true
useLocalCache: false
cmake_version: "~3.28.0"
ninja_version: "latest"
# Step 3: Remove any old cache (if necessary)
- name: Remove old cache (if exists)
run: |
rm -rf /home/runner/work/OrcaSlicer/OrcaSlicer/deps/build/
# Step 4: Create the deps folder if it doesn't exist
- name: Create deps folder
run: |
mkdir -p /home/runner/work/OrcaSlicer/OrcaSlicer/deps/build
# Step 5: Build dependencies and store them in the deps folder
- name: Build Dependencies
run: |
cd /home/runner/work/OrcaSlicer/OrcaSlicer
cmake -S . -B deps/build
cmake --build deps/build
# Ensure the build output is placed into the deps folder for caching
# Step 6: Cache the dependencies with a new key
- name: Cache dependencies
uses: actions/cache@v4
with:
path: /home/runner/work/OrcaSlicer/OrcaSlicer/deps/build/
key: ubuntu-24.04-arm-x86_64-cache-orcaslicer_deps-build-${{ hashFiles('**/CMakeLists.txt') }}-${{ github.sha }} # New cache key with hash and commit
restore-keys: |
ubuntu-24.04-arm-x86_64-cache-orcaslicer_deps-build-
# Step 7: Build the main project
- name: Build the main project
run: |
cd /home/runner/work/OrcaSlicer/OrcaSlicer
cmake --build . # Replace with your actual build commands
# Step 8: Additional steps as needed (e.g., testing, deployment, etc.)