conan v2 wip #55
This file contains hidden or 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: VCMI - dependencies | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: mac-intel | |
os: macos-14 | |
before_install: macos.sh | |
conan_profile: macos-intel | |
# - platform: mac-arm | |
# os: macos-14 | |
# before_install: macos.sh | |
# conan_profile: macos-arm | |
# - platform: ios | |
# os: macos-14 | |
# before_install: macos.sh | |
# conan_profile: ios-arm64 | |
- platform: android-armeabi-v7a | |
os: ubuntu-24.04 | |
conan_profile: android-32-ndk | |
# - platform: android-arm64-v8a | |
# os: ubuntu-24.04 | |
# conan_profile: android-64-ndk | |
- platform: windows-x64 | |
os: windows-2022 | |
before_install: msvc.sh | |
conan_profile: msvc-x64 | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# TODO | |
with: | |
repository: 'kambala-decapitator/vcmi' | |
ref: 'conan-v2' | |
- uses: actions/setup-java@v4 | |
if: ${{ startsWith(matrix.platform, 'android') }} | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Prepare CI | |
if: "${{ matrix.before_install != '' }}" | |
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}' | |
- name: Install Conan | |
run: pipx install conan | |
# TODO: | |
# 1. download our patches | |
# 2. build patched packages with conan create | |
# 3. build LuaJIT from PR changes with conan create | |
- name: Generate conan profile | |
run: | | |
conan profile detect | |
conan install . \ | |
--output-folder=conan-generated \ | |
--build=missing \ | |
--profile:build=default \ | |
--profile:host=CI/conan/${{ matrix.conan_profile }} \ | |
${{ matrix.conan_options }} | |
- name: Remove builds and source code | |
run: conan cache clean | |
- name: Remove build requirements | |
run: | | |
graphFile=graph.json | |
conan graph info . \ | |
--format=json \ | |
--build=never \ | |
--out-file "$graphFile" \ | |
--no-remote \ | |
--filter=context | |
buildPackagesSelector='.graph.nodes[] | select(.context == "build") | .ref' | |
buildPackages=$(jq -r "$buildPackagesSelector" "$graphFile" | sort | uniq) | |
for p in $buildPackages ; do | |
conan remove --confirm "$p:*" | |
done | |
- name: Create dependencies archive | |
run: conan cache save --file dependencies-${{matrix.platform}}.tgz '*:*' | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dependencies-${{ matrix.platform }} | |
compression-level: 0 | |
path: 'dependencies-${{matrix.platform}}.tgz' |