Skip to content
Draft
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
137 changes: 25 additions & 112 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:

orbs:
macos: circleci/macos@2.5.4
android: circleci/android@3.1.0
android: circleci/android@3.2.0
codecov: codecov/codecov@5.4.3

executors:
Expand Down Expand Up @@ -66,14 +66,6 @@ commands:
steps:
- attach_workspace:
at: ~/player
- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main
- gem-v1-{{ arch }}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-v1-{{ arch }}-main-{{ checksum "Gemfile.lock" }}

- setup_auth
- run: echo "//registry.npmjs.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: |
Expand All @@ -93,10 +85,6 @@ jobs:
- checkout:
method: full

- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: .
paths:
Expand All @@ -116,6 +104,7 @@ jobs:
root: .
paths:
- .

bazelrc_fork:
executor: minimal
steps:
Expand Down Expand Up @@ -144,17 +133,12 @@ jobs:

- run: bazel build --config=ci -- $(bazel query 'filter("native_bundle$", //...)')

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- persist_to_workspace:
root: .
paths:
- .

build_ios:
build_and_test_ios:
executor: ios
steps:
- attach_workspace:
Expand Down Expand Up @@ -190,7 +174,6 @@ jobs:
--config=ci-mac \
--jobs=1 \
--experimental_use_llvm_covmap \
--combined_report=lcov \
--test_output=all \
--test_timeout=1800 \
$(bazel query "kind(ios_unit_test, //ios/...)") \
Expand All @@ -214,16 +197,9 @@ jobs:
mkdir -p $RESULTS_DIR/$(dirname $line)
cp $line $RESULTS_DIR/$(dirname $line)
done
- run:
when: always
command: |
mkdir -p _ios_coverage/lcov
cp -r $(bazel info output_path)/_coverage/_coverage_report.dat _ios_coverage/lcov/

- persist_to_workspace:
root: .
paths:
- _ios_coverage
- codecov/upload:
files: ./bazel-out/_coverage/_coverage_report.dat

- store_test_results:
path: _test_results
Expand All @@ -238,6 +214,8 @@ jobs:

- run: bazel test --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test

- run: bazel coverage --config=ci -- $(bazel query 'kind(".*_test", //...) except filter("ios|swiftui", //...)') -//android/demo:android_instrumentation_test

- run:
when: always
command: |
Expand All @@ -248,6 +226,9 @@ jobs:
cp $line $RESULTS_DIR/$(dirname $line)
done

- codecov/upload:
files: ./bazel-out/_coverage/_coverage_report.dat

- store_test_results:
path: _test_results

Expand Down Expand Up @@ -287,50 +268,12 @@ jobs:
- store_artifacts:
path: screenshots

coverage:
executor: base
steps:
- attach_workspace:
at: ~/player

- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main

- run: |
BUNDLE_TARGETS=$(bazel query "kind(.*_test, //...) except filter('android|ios|swiftui', //...)" --output label 2>/dev/null | tr '\n' ' ')
bazel coverage --combined_report=lcov --config=ci -- $BUNDLE_TARGETS

- run:
when: always
command: |
RESULTS_DIR=_test_results
find -L ./bazel-testlogs -name test.xml | while read line
do
mkdir -p $RESULTS_DIR/$(dirname $line)
cp $line $RESULTS_DIR/$(dirname $line)
done

- store_test_results:
path: _test_results

- codecov/upload:
files: ./bazel-out/_coverage/_coverage_report.dat,./_ios_coverage/lcov/_coverage_report.dat

bundle_analyze:
executor: base
steps:
- attach_workspace:
at: ~/player

- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main

- run: ./scripts/bundle-analyze.sh

maybe_release:
Expand All @@ -349,11 +292,6 @@ jobs:
steps:
- attach_workspace:
at: ~/player
- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main
- setup_auth
- run:
name: Check if docs should run
Expand Down Expand Up @@ -390,11 +328,6 @@ jobs:
steps:
- attach_workspace:
at: ~/player
- restore_cache:
keys:
- v1-bazel-cache-core-{{ .Branch }}-{{ .Revision }}
- v1-bazel-cache-core-{{ .Branch }}
- v1-bazel-cache-core-main
- run:
name: Build docs
command: |
Expand Down Expand Up @@ -466,7 +399,7 @@ workflows:
- setup
- bazelrc_fork

- build_ios:
- build_and_test_ios:
name: build-ios-trunk
filters:
branches:
Expand All @@ -476,7 +409,7 @@ workflows:
- bazelrc
- build-trunk

- build_ios:
- build_and_test_ios:
name: build-ios-fork
filters:
branches:
Expand Down Expand Up @@ -538,26 +471,6 @@ workflows:
requires:
- build-fork

- coverage:
name: coverage-trunk
filters:
branches:
ignore:
- /pull\/.*/
requires:
- build-trunk
- build-ios-trunk

- coverage:
name: coverage-fork
filters:
branches:
only:
- /pull\/.*/
requires:
- build-fork
- build-ios-fork

- bundle_analyze:
name: bundle-analyze-trunk
filters:
Expand Down Expand Up @@ -636,7 +549,7 @@ workflows:
requires:
- bazelrc

- build_ios:
- build_and_test_ios:
requires:
- build

Expand All @@ -646,30 +559,30 @@ workflows:
requires:
- build

- coverage:
- test:
requires:
- build
- build_ios
- build_and_test_ios

- bundle_analyze:
name: bundle-analyze
requires:
- coverage
- test

- build_docs:
context:
- Publish
requires:
- coverage
- test

- release:
context:
- Publish
requires:
- android_test
- coverage
- test
- bundle-analyze
- build_ios
- build_and_test_ios
- build_docs

full_release:
Expand All @@ -688,7 +601,7 @@ workflows:
requires:
- setup

- build_ios:
- build_and_test_ios:
requires:
- bazelrc

Expand All @@ -698,27 +611,27 @@ workflows:
requires:
- build

- coverage:
- test:
requires:
- build

- bundle_analyze:
name: bundle-analyze
requires:
- coverage
- test

- build_docs:
context:
- Publish
requires:
- coverage
- test

- release:
context:
- Publish
requires:
- android_test
- coverage
- test
- bundle_analyze
- build_ios
- build_and_test_ios
- build_docs