Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .ccache/ccache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
depend_mode = true
direct_mode = true
hard_link = true
run_second_cpp = true
sloppiness = file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,modules,system_headers,time_macros
28 changes: 13 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ jobs:
name: 'macOS'
runs-on: macos-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v3.3.0
with:
node-version: 16
- name: Checkout
uses: actions/checkout@v3
- name: Cache /.cache/yarn
- name: Cache /.ccache
uses: actions/cache@v3
with:
path: .cache/yarn
key: ${{ hashFiles('yarn.lock') }}
path: .ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-ccache-
- name: Set up Node.js
uses: actions/setup-node@v3.4.1
with:
node-version: 16
cache: 'yarn'
- name: Install JS dependencies
run: |
yarn ci
Expand All @@ -41,17 +43,13 @@ jobs:
uses: microsoft/setup-msbuild@v1.1
- name: Setup VSTest.console.exe
uses: darenm/Setup-VSTest@v1
- name: Set up Node.js
uses: actions/setup-node@v3.3.0
with:
node-version: 16
- name: Checkout
uses: actions/checkout@v3
- name: Cache /.cache/yarn
uses: actions/cache@v3
- name: Set up Node.js
uses: actions/setup-node@v3.4.1
with:
path: .cache/yarn
key: ${{ hashFiles('yarn.lock') }}
node-version: 16
cache: 'yarn'
- name: Install JS dependencies
run: |
yarn ci
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://github.com/react-native-async-storage/async-storage.git"
},
"scripts": {
"ci": "yarn --pure-lockfile --non-interactive --cache-folder .cache/yarn",
"ci": "yarn --pure-lockfile --non-interactive",
"format": "concurrently yarn:format:*",
"format:c": "clang-format -i $(git ls-files '*.cpp' '*.h' '*.m' '*.mm')",
"format:js": "prettier --write $(git ls-files '*.js' '*.json' '*.md' '*.ts' '*.tsx' '*.yml')",
Expand Down
21 changes: 21 additions & 0 deletions scripts/macos_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

BUILD_ACTIONS="$@"

if [[ "$CCACHE_DISABLE" != "1" ]]; then
if ! command -v ccache 1> /dev/null; then
brew install ccache
fi

CCACHE_HOME=$(dirname $(dirname $(which ccache)))/opt/ccache

export CCACHE_DIR="$(git rev-parse --show-toplevel)/.ccache"

export CC="${CCACHE_HOME}/libexec/clang"
export CXX="${CCACHE_HOME}/libexec/clang++"
export CMAKE_C_COMPILER_LAUNCHER=$(which ccache)
export CMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)

ccache --zero-stats 1> /dev/null
fi

# Workaround for `Element StaticText, {{163.0, 836.0}, {156.0, 21.0}}, value: Set native delegate is not hittable`.
# This occurs when a button is not visible in the window. We resize the window
# here to ensure that it is.
Expand All @@ -15,4 +32,8 @@ xcodebuild \
-derivedDataPath example/macos/build \
$BUILD_ACTIONS

if [[ "$CCACHE_DISABLE" != "1" ]]; then
ccache --show-stats --verbose
fi

exit $?