Skip to content

Commit 079e768

Browse files
authored
[chore] Execute react native android build on CI (open-telemetry#3164)
* [chore] Execute react native android build on CI * pin gh actions * pin github action * fix build configuration
1 parent 95d9567 commit 079e768

2 files changed

Lines changed: 52 additions & 1 deletion

File tree

.github/workflows/checks.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,25 @@ jobs:
8484
- name: run checklicense
8585
run: make checklicense
8686

87+
check-react-native-changes:
88+
runs-on: ubuntu-latest
89+
outputs:
90+
should_build: ${{ steps.filter.outputs.react_native }}
91+
steps:
92+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
93+
- uses: dorny/paths-filter@v3
94+
id: filter
95+
with:
96+
filters: |
97+
react_native:
98+
- 'src/react-native-app/**'
99+
- '.github/workflows/**'
100+
101+
react-native-android:
102+
needs: check-react-native-changes
103+
if: needs.check-react-native-changes.outputs.should_build == 'true'
104+
uses: ./.github/workflows/react-native-build.yml
105+
87106
build-test:
88107
needs: [
89108
build_images,
@@ -92,7 +111,8 @@ jobs:
92111
misspell,
93112
checklinks,
94113
sanity,
95-
checklicense
114+
checklicense,
115+
react-native-android
96116
]
97117
if: always() && !cancelled()
98118
runs-on: ubuntu-latest
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
on:
5+
workflow_call:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build-android:
12+
name: Build Android APK
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
21+
22+
- name: Build Android APK
23+
run: make build-react-native-android
24+
25+
- name: Verify APK was created
26+
run: |
27+
if [ ! -f reactnativeapp.apk ]; then
28+
echo "APK build failed"
29+
exit 1
30+
fi
31+
echo "APK size: $(du -h reactnativeapp.apk | cut -f1)"

0 commit comments

Comments
 (0)