build all #254
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 | ||
on: | ||
push: | ||
paths: | ||
- 'recipes/**' | ||
schedule: | ||
# Executed daily, 9:37 is randomly picked time, not 00:00, | ||
# because 00:00 is used too frequently and GitHub asks to do cronjobs at less busy times | ||
- cron: '37 9 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
package_name: | ||
description: Package name | ||
type: choice | ||
options: | ||
- all | ||
- odrcore | ||
- pdf2htmlex | ||
- fontforge | ||
- poppler | ||
- poppler-data | ||
- cairo | ||
- openlibm | ||
- fontconfig | ||
- glib | ||
- tmpfile | ||
package_version: | ||
description: Package version. Specify 'newest' or leave empty to request the newest version. Specify 'all' to request all versions. | ||
required: false | ||
upload_to_artifactory: | ||
description: Upload built packages to artifactory | ||
type: boolean | ||
default: false | ||
build_dependents: | ||
description: Parse conan dependency tree and build not just the requested package, but also all dependents of it | ||
type: boolean | ||
default: true | ||
build_dependencies_from_source: | ||
description: Build all dependencies from source (conan install --build=* instead of --build=missing) | ||
type: boolean | ||
default: false | ||
run-name: build ${{ inputs.package_name }} | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
generate-matrices: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
packages_0: ${{ steps.list-packages-with-dependents.outputs.packages_0 }} | ||
packages_1: ${{ steps.list-packages-with-dependents.outputs.packages_1 }} | ||
packages_2: ${{ steps.list-packages-with-dependents.outputs.packages_2 }} | ||
packages_3: ${{ steps.list-packages-with-dependents.outputs.packages_3 }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# Fetch whole git history. | ||
# Required to parse modified packages | ||
fetch-depth: 0 | ||
- 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: conan config | ||
run: conan config install .github/config/ubuntu-22.04/conan | ||
- name: Conan export all packages | ||
run: python scripts/conan_export_all_packages.py | ||
# Generate dependency graphs for all disjoint packages | ||
# Dependency graphs for android-21 and android-23 profiles are not identical. | ||
# android-21 has an extra openlibm dependency. Android ABI does not matter for dependency graph, as long as it's still Android. | ||
# Generating graphs for both 21 and 23 would be more self-explanatory, but conan graph generation takes a few seconds. | ||
- name: Generate odrcore dependency tree | ||
id: odrcore-dependency-tree | ||
if: ${{ github.event.inputs.build_dependents != 'false' }} | ||
shell: bash # bash shell needed to pipefail on error | ||
run: | | ||
conan graph info recipes/odrcore/all/conanfile.py --version=4.0.0 --profile:host=android-21-armv8 --format=json | tee odrcore-dependency-tree.json | ||
echo "graph_file=odrcore-dependency-tree.json" >> $GITHUB_OUTPUT | ||
# Once odrcore depends on pdf2htmlex, pdf2htmlEX-dependency-tree.json generation and usage can be removed | ||
- name: Generate pdf2htmlex dependency tree | ||
id: pdf2htmlex-dependency-tree | ||
if: ${{ github.event.inputs.build_dependents != 'false' }} | ||
shell: bash # bash shell needed to pipefail on error | ||
run: | | ||
conan graph info recipes/pdf2htmlex/all/conanfile.py --version=0.18.8.rc1-20240619-git --profile:host=android-21-armv8 --format=json | tee pdf2htmlEX-dependency-tree.json | ||
echo "graph_file=pdf2htmlEX-dependency-tree.json" >> $GITHUB_OUTPUT | ||
- name: Get requested packages and dependants from commits and workflow_dispatch inputs | ||
id: list-packages-with-dependents | ||
run: python scripts/list_package_versions.py --dependency-graph ${{ steps.odrcore-dependency-tree.outputs.graph_file }} ${{ steps.pdf2htmlex-dependency-tree.outputs.graph_file }} | ||
env: | ||
GITHUB_EVENT: ${{ toJson(github.event) }} | ||
build_0: | ||
if: ${{ needs.generate-matrices.outputs.packages_0 != '[]' && needs.generate-matrices.outputs.packages_0 != '' }} | ||
name: ${{ matrix.package.package_reference }} | ||
needs: | ||
- generate-matrices | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{ fromJson(needs.generate-matrices.outputs.packages_0) }} | ||
uses: ./.github/workflows/build_inner.yml | ||
with: | ||
conanfile: ${{ matrix.package.conanfile }} | ||
package_version: ${{ matrix.package.version }} | ||
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }} | ||
artifactory_upload: ${{ secrets.ARTIFACTORY != '' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true') }} | ||
Check failure on line 119 in .github/workflows/build.yml GitHub Actions / buildInvalid workflow file
|
||
secrets: | ||
ARTIFACTORY: ${{ secrets.ARTIFACTORY }} | ||
build_1: | ||
if: ${{ needs.generate-matrices.outputs.packages_1 != '[]' && needs.generate-matrices.outputs.packages_1 != '' }} | ||
name: ${{ matrix.package.package_reference }} | ||
needs: | ||
- generate-matrices | ||
- build_0 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{ fromJson(needs.generate-matrices.outputs.packages_1) }} | ||
uses: ./.github/workflows/build_inner.yml | ||
with: | ||
conanfile: ${{ matrix.package.conanfile }} | ||
package_version: ${{ matrix.package.version }} | ||
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }} | ||
artifactory_upload: ${{ secrets.ARTIFACTORY != '' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true') }} | ||
secrets: | ||
ARTIFACTORY: ${{ secrets.ARTIFACTORY }} | ||
build_2: | ||
if: ${{ needs.generate-matrices.outputs.packages_2 != '[]' && needs.generate-matrices.outputs.packages_2 != '' }} | ||
name: ${{ matrix.package.package_reference }} | ||
needs: | ||
- generate-matrices | ||
- build_1 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{ fromJson(needs.generate-matrices.outputs.packages_2) }} | ||
uses: ./.github/workflows/build_inner.yml | ||
with: | ||
conanfile: ${{ matrix.package.conanfile }} | ||
package_version: ${{ matrix.package.version }} | ||
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }} | ||
artifactory_upload: ${{ secrets.ARTIFACTORY != '' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true') }} | ||
secrets: | ||
ARTIFACTORY: ${{ secrets.ARTIFACTORY }} | ||
build_3: | ||
if: ${{ needs.generate-matrices.outputs.packages_3 != '[]' && needs.generate-matrices.outputs.packages_3 != '' }} | ||
name: ${{ matrix.package.package_reference }} | ||
needs: | ||
- generate-matrices | ||
- build_2 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{ fromJson(needs.generate-matrices.outputs.packages_3) }} | ||
uses: ./.github/workflows/build_inner.yml | ||
with: | ||
conanfile: ${{ matrix.package.conanfile }} | ||
package_version: ${{ matrix.package.version }} | ||
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }} | ||
artifactory_upload: ${{ secrets.ARTIFACTORY != '' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true') }} | ||
secrets: | ||
ARTIFACTORY: ${{ secrets.ARTIFACTORY }} |