CI build for Android #106
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build_test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
CCACHE_DIR: ${{ github.workspace }}/ccache | |
CCACHE_MAXSIZE: 500M | |
CCACHE_KEY_SUFFIX: r1 | |
jobs: | |
find-all-packages: | |
runs-on: ubuntu-22.04 | |
outputs: | |
packages: ${{ steps.list-packages.outputs.packages }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: setup python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: install python dependencies | |
run: pip install --upgrade pip pyyaml | |
- name: List all packages | |
run: python scripts/list_package_versions.py | |
- name: List all packages in GitHub Actions format | |
id: list-packages | |
run: python scripts/list_package_versions.py --github | tee $GITHUB_OUTPUT | |
build: | |
runs-on: ${{ matrix.config.build_machine }} | |
name: ${{ matrix.package.package_reference }} - ${{ matrix.config.host_profile }} | |
needs: | |
- find-all-packages | |
strategy: | |
fail-fast: false | |
matrix: | |
package: ${{ fromJson(needs.find-all-packages.outputs.packages) }} | |
config: | |
- { build_machine: ubuntu-22.04, host_profile: ubuntu } | |
- { build_machine: ubuntu-22.04, host_profile: android-23-armv8, ndk_version: 26.3.11579264 } | |
# Known not working build configurations | |
exclude: | |
- package: { "package_reference": "odrcore/1.0.0", "package": "odrcore", "version": "1.0.0", "conanfile": "recipes/odrcore/all/conanfile.py" } | |
config: { build_machine: ubuntu-22.04, host_profile: android-23-armv8, ndk_version: 26.3.11579264 } | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: ubuntu install ccache | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt install ccache | |
ccache -V | |
- name: macos install ccache | |
if: runner.os == 'macOS' | |
run: | | |
brew install ccache | |
ccache -V | |
- name: setup python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: install python dependencies | |
run: pip install --upgrade pip conan | |
- name: install NDK | |
if: startsWith(matrix.config.host_profile, 'android') | |
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ matrix.config.ndk_version }}" | |
- name: conan remote | |
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan | |
- name: conan config | |
run: conan config install .github/config/${{ matrix.config.build_machine }}/conan | |
- name: cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.ccache | |
/Users/runner/Library/Caches/ccache | |
key: ${{ matrix.config.build_machine }}-${{ matrix.config.host_profile }}-${{ env.CCACHE_KEY_SUFFIX }} | |
restore-keys: | | |
${{ matrix.config.build_machine }}-${{ matrix.config.host_profile }}- | |
- name: conan install | |
run: conan install ${{ matrix.package.conanfile }} --version ${{ matrix.package.version }} --build missing --profile:host ${{ matrix.config.host_profile }} | |
- 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 }} --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 }} --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_reference }} --build missing --profile:host ${{ matrix.config.host_profile }} | |
- name: conan login | |
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }} | |
- name: conan upload | |
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' | |
run: conan upload "*" --check --confirm --remote odr |