-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (112 loc) · 4.83 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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.os }}
needs:
- find-all-packages
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.find-all-packages.outputs.packages) }}
config:
# - { os: ubuntu-22.04, compiler: clang-15, host-profile: host }
- { os: ubuntu-22.04, compiler: ndk-26.3.11579264, host-profile: armv8 }
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: 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
if: startsWith(matrix.config.compiler, 'ndk-')
run: |
perl -pi -e "s/\$ANDROID_HOME/$ANDROID_HOME/g" .github/config/${{ matrix.config.os }}-${{ matrix.config.compiler }}/conan/*
cat .github/config/${{ matrix.config.os }}-${{ matrix.config.compiler }}/conan/*
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies
run: pip install --upgrade conan
- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
# - name: conan login
# run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
- name: conan config
run: conan config install .github/config/${{ matrix.config.os }}-${{ matrix.config.compiler }}/conan
- run: ls `conan config home`/profiles
# - name: cache
# uses: actions/cache@v4
# with:
# path: |
# ~/.ccache
# /Users/runner/Library/Caches/ccache
# key: ${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ env.CCACHE_KEY_SUFFIX }}
# restore-keys: |
# ${{ matrix.config.os }}-${{ matrix.config.compiler }}-
- name: conan install
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: ${{ matrix.package.conanfile }}-${{ 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 }} --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 }}
- name: conan test
run: |
test_conanfile=$(dirname ${{ matrix.package.conanfile }})/test_package/conanfile.py
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'
run: conan upload "*" --check --confirm --remote odr