-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI build for Android #3
Changes from 2 commits
b0580fc
a8405c0
220e557
b3088ef
b2cba3f
64f73e7
7d1a1bd
300187e
2ce3cb9
5d0d644
7020959
92d6978
5dc5afc
6175876
71d8669
e0495be
96075e5
74e2ad7
3c5a3a3
1f949b9
2da8205
9db47be
befbf53
cb0cf52
a39d79b
85ac402
37bb728
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(host) | ||
|
||
[settings] | ||
arch=armv7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(host) | ||
|
||
[settings] | ||
arch=armv8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../ubuntu-22.04-clang-15/conan/profiles/default |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
include(default) | ||
|
||
[settings] | ||
os=Android | ||
os.api_level=23 | ||
arch=armv8 | ||
compiler=clang | ||
compiler.version=17 | ||
compiler.libcxx=c++_static | ||
compiler.cppstd=20 | ||
|
||
[conf] | ||
tools.android:ndk_path=$ANDROID_HOME/ndk/26.3.11579264 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(host) | ||
|
||
[settings] | ||
arch=x86 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
include(host) | ||
|
||
[settings] | ||
arch=x86_64 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,11 @@ jobs: | |
matrix: | ||
package: ${{ fromJson(needs.find-all-packages.outputs.packages) }} | ||
config: | ||
- { os: ubuntu-22.04, compiler: clang-15 } | ||
- { os: ubuntu-22.04, compiler: clang-15, host-profile: host } | ||
- { os: ubuntu-22.04, compiler: ndk-26.3.11579264, host-profile: armv8 } | ||
- { os: ubuntu-22.04, compiler: ndk-26.3.11579264, host-profile: x86_64 } | ||
- { os: ubuntu-22.04, compiler: ndk-26.3.11579264, host-profile: armv7 } | ||
- { os: ubuntu-22.04, compiler: ndk-26.3.11579264, host-profile: x86 } | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -64,6 +68,13 @@ jobs: | |
brew install ccache | ||
ccache -V | ||
|
||
- name: install ndk | ||
if: startsWith(matrix.config.compiler, 'ndk-') | ||
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install `echo "${{ matrix.config.compiler }}" | tr - ";"` | ||
- name: expand ANDROID_HOME env var in conan profile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't find a way to put $ANDROID_HOME in conan profile. Don't want to hardcode the path because it would be unusable on my development machine There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we had a similar problem in the android repo. Hardcoding would be last resort but I don't think it is terrible because it is an github specific profile. Locally we could emulate the github ci with https://github.com/nektos/act There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should file an enhancement request to conan, because I don't believe we are the only ones who want to put $ANDROID_HOME env var in conan profile |
||
if: startsWith(matrix.config.compiler, 'ndk-') | ||
run: perl -pi -e 's/\$ANDROID_HOME/$ENV{ANDROID_HOME}/g' .github/config/${{ matrix.config.os }}-${{ matrix.config.compiler }}/conan/profiles/host | ||
|
||
- name: setup python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -89,20 +100,30 @@ jobs: | |
${{ matrix.config.os }}-${{ matrix.config.compiler }}- | ||
|
||
- name: conan install | ||
run: conan install ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --build missing | ||
run: conan install ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --build missing --profile:host ${{ matrix.config.host-profile }} | ||
|
||
- name: conan graph | ||
if: always() | ||
run: conan graph info ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --format=html --profile:host ${{ matrix.config.host-profile }} > graph.html | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: graph.html.${{ matrix.package.package }}-${{ matrix.package.version }}-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.host-profile }} | ||
path: graph.html | ||
|
||
- name: conan source | ||
run: conan source ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} | ||
- name: conan build | ||
run: conan build ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} | ||
run: conan build ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --profile:host ${{ matrix.config.host-profile }} | ||
- name: conan export | ||
run: conan export ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} | ||
- name: conan export-pkg | ||
run: conan export-pkg ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} | ||
run: conan export-pkg ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --profile:host ${{ matrix.config.host-profile }} | ||
|
||
- name: conan test | ||
run: | | ||
test_conanfile=$(dirname ${{ matrix.package.conanfile }})/test_package/conanfile.py | ||
conan test $test_conanfile ${{ matrix.package.package_version }} --build missing | ||
conan test $test_conanfile ${{ matrix.package.package_version }} --build missing --profile:host ${{ matrix.config.host-profile }} | ||
|
||
- name: conan upload | ||
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure yet if Android makes sense here but I would say at maximum one? Because otherwise we launch a very big amount of jobs.
I think
compiler
should stick with theclang
rather thanndk-26.3.11579264
. I guess we could have build OS and host OS to make this a bit cleaner?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well it depends on how we want to use this odr-index repo.
Small matrix here means faster builds here and our artifactory is more like a recipe index, but this means slow builds for downstream users, because most of the time, downstream users would have to build these conan packages from source.
Big matrix here means slower builds here, but fast builds for downstream users, because downstream users would be able to find binary packages that were built here. Mind you, downstream users (odr.droid) need binaries from all 4 Android ABIs.
How is artifactory charging us for the repository? Does the amount of binaries that we upload have an actual cost? Or is it in gigabytes and we don't actually have to care? Big matrix here does not have that much of an impact on GitHub side, the repo is open source, so we don't have to worry about GitHub charges, only the run time, but if all the dependencies are already available as binaries, each of them wouldn't take that long, it's not in the hours as it was when I was building pdf2htmlEX dependencies from source each time :D
As for the
compiler
,clang
andndk-26.3.11579264
, I don't really care about the actual naming, what I need is a way to specify build and host profiles. And I also need some kind of a variable to specify NDK version, because NDK needs to be installed manually