1- name : Setup the toolchain
1+ name : Setup toolchain
22description : Sets up the toolchain for the project
33inputs :
4- node-version :
5- description : The version of Node to use
6- type : string
7- default : " 20"
8- node-cache :
9- description : Cache global packages data
10- type : string
11- default : " yarn"
12- jdk-version :
13- description : The Java JDK version to use, if specified
14- type : number
154 platform :
165 description : The target platform to set up toolchain for
17- type : string
18- xcode-version :
19- description : The Xcode version to use (full path)
20- type : string
21- default : " /Applications/Xcode_16.4.0.app"
6+ project-root :
7+ description : Root of the project
8+ cache-key-prefix :
9+ description : Prefix to add to the cache key
10+ cache-npm-dependencies :
11+ description : Caches npm dependencies (supports npm, yarn, pnpm v6.10+)
12+ default : yarn
13+ java-version :
14+ description : Desired Java version
15+ default : " 17"
16+ node-version :
17+ description : Desired Node version
18+ default : " 22"
19+ xcode-developer-dir :
20+ description : Set the path for the active Xcode developer directory
2221runs :
2322 using : composite
2423 steps :
2524 - name : Set up Ccache
2625 id : setup-ccache
27- if : ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'xros ' }}
26+ if : ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'visionos ' }}
2827 run : |
29- podfile_lock="packages/test-app /${{ inputs.platform }}/Podfile.lock"
28+ podfile_lock="${{ inputs.project-root }} /${{ inputs.platform }}/Podfile.lock"
3029 if [[ -f $(git rev-parse --show-toplevel)/.ccache/ccache.conf ]] && [[ -f "$podfile_lock" ]]; then
30+ if ! command -v ccache 1> /dev/null; then
31+ brew install ccache
32+ fi
33+
34+ CCACHE_HOME=$(dirname $(dirname $(which ccache)))/opt/ccache
35+
36+ echo "CCACHE_DIR=$(git rev-parse --show-toplevel)/.ccache" >> $GITHUB_ENV
37+
38+ echo "CC=${CCACHE_HOME}/libexec/clang" >> $GITHUB_ENV
39+ echo "CXX=${CCACHE_HOME}/libexec/clang++" >> $GITHUB_ENV
40+ echo "CMAKE_C_COMPILER_LAUNCHER=$(which ccache)" >> $GITHUB_ENV
41+ echo "CMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)" >> $GITHUB_ENV
42+
43+ ccache --zero-stats 1> /dev/null
44+
3145 clang --version > .clang-version
3246 input=$(find . -maxdepth 1 -name .clang-version -o -name .yarnrc.yml | sort)
3347 echo "cache-key=$(cat "$podfile_lock" $input | shasum -a 256 | awk '{ print $1 }')" >> $GITHUB_OUTPUT
3448 fi
3549 shell : bash
36- - name : Set up Node.js
37- uses : actions/setup-node@v4.4.0
38- with :
39- node-version : ${{ inputs.node-version }}
40- cache : ${{ inputs.node-cache }}
4150 - name : Set up JDK
42- if : ${{ inputs.jdk-version != 0 }}
51+ if : ${{ inputs.platform == 'android' || inputs.platform == 'node' }}
4352 uses : actions/setup-java@v4
4453 with :
4554 distribution : temurin
46- java-version : ${{ inputs.jdk-version }}
47- - name : Install Homebrew dependencies (macOS/iOS)
48- if : ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'xros' }}
49- run : |
50- brew install xcbeautify ccache
51- shell : bash
52- - name : Setup Xcode
53- if : ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'xros' }}
55+ java-version : ${{ inputs.java-version }}
56+ - name : Set up Gradle
57+ if : ${{ inputs.platform == 'android' || inputs.platform == 'node' }}
58+ uses : gradle/actions/setup-gradle@v4
59+ with :
60+ gradle-version : wrapper
61+ gradle-home-cache-excludes : |
62+ caches
63+ jdks
64+ - name : Set up MSBuild
65+ if : ${{ inputs.platform == 'windows' }}
66+ uses : microsoft/setup-msbuild@v2
67+ - name : Set up Ruby
68+ if : ${{ runner.os != 'Windows' }}
69+ uses : ruby/setup-ruby@v1
70+ with :
71+ ruby-version : " 3.2.3"
72+ bundler : Gemfile.lock
73+ bundler-cache : true
74+ - name : Set up Node.js
75+ uses : actions/setup-node@v4.4.0
76+ with :
77+ node-version : ${{ inputs.node-version }}
78+ cache : ${{ inputs.cache-npm-dependencies }}
79+ registry-url : https://registry.npmjs.org
80+ - name : Set up Xcode
81+ if : ${{ inputs.xcode-developer-dir != '' }}
5482 run : |
55- sudo xcode-select --switch ${{ inputs.xcode-version }}
83+ sudo xcode-select --switch ${{ inputs.xcode-developer-dir }}
5684 shell : bash
57- - name : Download Xcode Platforms
58- if : ${{ inputs.platform == 'ios' || inputs.platform == 'macos' || inputs.platform == 'xros ' }}
85+ - name : Download visionOS SDK
86+ if : ${{ inputs.platform == 'visionos ' }}
5987 run : |
60- xcodebuild -downloadAllPlatforms
88+ # https://github.com/actions/runner-images/issues/10559
89+ sudo xcodebuild -runFirstLaunch
90+ sudo xcrun simctl list
91+ sudo xcodebuild -downloadPlatform visionOS
6192 sudo xcodebuild -runFirstLaunch
6293 shell : bash
6394 - name : Cache /.ccache
6495 if : ${{ steps.setup-ccache.outputs.cache-key }}
6596 uses : actions/cache@v4
6697 with :
6798 path : .ccache
68- key : ${{ runner.os }}-${{ inputs.cache-key-prefix }}-ccache-${{ steps.setup-ccache.outputs.cache-key }}
99+ key : ${{ runner.os }}-${{ inputs.cache-key-prefix }}-ccache-${{ steps.setup-ccache.outputs.cache-key }}
0 commit comments