|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-22.04 |
| 8 | + |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + api-version: [5.5, 6.5] |
| 12 | + arch: [arm, arm64, x86] |
| 13 | + include: |
| 14 | + - arch: arm |
| 15 | + triple: arm-linux-gnueabi |
| 16 | + - arch: arm64 |
| 17 | + triple: aarch64-linux-gnu |
| 18 | + - arch: x86 |
| 19 | + triple: i686-linux-gnu |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v3 |
| 23 | + with: |
| 24 | + path: src |
| 25 | + |
| 26 | + - uses: actions/cache@v3 |
| 27 | + with: |
| 28 | + path: src/sysroot* |
| 29 | + key: sysroot-${{ matrix.api-version }} |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + sudo apt-get update |
| 34 | + sudo apt-get install -y rpm2cpio cpio binutils-${{ matrix.triple }} |
| 35 | + pip3 install requests |
| 36 | +
|
| 37 | + - name: Install depot_tools |
| 38 | + run: | |
| 39 | + git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 40 | + echo "$PWD/depot_tools" >> $GITHUB_PATH |
| 41 | +
|
| 42 | + - name: Run gclient sync |
| 43 | + run: | |
| 44 | + gclient config --name=src --unmanaged https://github.com/${{ github.repository }} |
| 45 | + gclient sync -v --no-history --shallow |
| 46 | +
|
| 47 | + - name: Generate Tizen 6.5 sysroot |
| 48 | + if: ${{ matrix.api-version == 6.5 }} |
| 49 | + run: src/tools/generate_sysroot.py --api-version 6.5 --out src/sysroot-6.5 |
| 50 | + |
| 51 | + - name: Build for Tizen 5.5 |
| 52 | + if: ${{ matrix.api-version == 5.5 }} |
| 53 | + run: | |
| 54 | + src/tools/gn \ |
| 55 | + --target-cpu ${{ matrix.arch }} \ |
| 56 | + --target-toolchain /usr/lib/llvm-14 \ |
| 57 | + --target-dir build |
| 58 | + ninja -C src/out/build |
| 59 | +
|
| 60 | + - name: Build for Tizen 6.5 |
| 61 | + if: ${{ matrix.api-version == 6.5 }} |
| 62 | + run: | |
| 63 | + src/tools/gn \ |
| 64 | + --target-cpu ${{ matrix.arch }} \ |
| 65 | + --target-toolchain /usr/lib/llvm-14 \ |
| 66 | + --target-sysroot src/sysroot-6.5/${{ matrix.arch }} \ |
| 67 | + --api-version 6.5 --system-cxx \ |
| 68 | + --target-dir build |
| 69 | + ninja -C src/out/build |
| 70 | +
|
| 71 | + - uses: actions/upload-artifact@v3 |
| 72 | + with: |
| 73 | + name: tizen-${{ matrix.api-version }}-${{ matrix.arch }} |
| 74 | + path: src/out/build/libflutter_tizen*.so |
| 75 | + if-no-files-found: error |
| 76 | + |
| 77 | + - uses: actions/upload-artifact@v3 |
| 78 | + with: |
| 79 | + name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_unittests |
| 80 | + path: src/out/build/flutter_tizen_unittests |
| 81 | + if-no-files-found: error |
| 82 | + |
| 83 | + - uses: actions/upload-artifact@v3 |
| 84 | + if: ${{ github.event_name == 'push' }} |
| 85 | + with: |
| 86 | + name: tizen-${{ matrix.api-version }}-${{ matrix.arch }}_symbols |
| 87 | + path: src/out/build/so.unstripped/libflutter_tizen*.so |
| 88 | + if-no-files-found: error |
| 89 | + |
| 90 | + - uses: actions/upload-artifact@v3 |
| 91 | + if: ${{ matrix.arch == 'arm' && matrix.api-version == 5.5 }} |
| 92 | + with: |
| 93 | + name: tizen-common |
| 94 | + path: | |
| 95 | + src/out/build/cpp_client_wrapper |
| 96 | + src/out/build/icu |
| 97 | + src/out/build/public |
| 98 | + if-no-files-found: error |
| 99 | + |
| 100 | + test: |
| 101 | + needs: build |
| 102 | + runs-on: ubuntu-latest |
| 103 | + |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v3 |
| 106 | + |
| 107 | + - uses: docker/setup-qemu-action@v2 |
| 108 | + with: |
| 109 | + platforms: arm |
| 110 | + |
| 111 | + - uses: docker/login-action@v2 |
| 112 | + with: |
| 113 | + registry: ghcr.io |
| 114 | + username: ${{ github.repository_owner }} |
| 115 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 116 | + |
| 117 | + - uses: actions/download-artifact@v3 |
| 118 | + with: |
| 119 | + name: tizen-5.5-arm_unittests |
| 120 | + |
| 121 | + - name: Download engine |
| 122 | + run: | |
| 123 | + python3 tools/download_engine.py |
| 124 | + cp engine/arm/libflutter_engine.so . |
| 125 | + rm -rf engine |
| 126 | +
|
| 127 | + - name: Run tests |
| 128 | + run: | |
| 129 | + chmod +x flutter_tizen_unittests |
| 130 | + docker run --rm -t -v $PWD:/root ghcr.io/flutter-tizen/tizen-headed-armv7l /root/flutter_tizen_unittests |
| 131 | +
|
| 132 | + release: |
| 133 | + needs: test |
| 134 | + if: ${{ github.event_name == 'push' && github.ref_name == 'master' }} |
| 135 | + runs-on: ubuntu-latest |
| 136 | + |
| 137 | + steps: |
| 138 | + - uses: actions/checkout@v3 |
| 139 | + |
| 140 | + - uses: actions/download-artifact@v3 |
| 141 | + |
| 142 | + - name: Create archives |
| 143 | + run: | |
| 144 | + rm -r *_unittests |
| 145 | + for name in tizen-*; do |
| 146 | + 7z a $name.zip ./$name/* |
| 147 | + done |
| 148 | +
|
| 149 | + - name: Set variable |
| 150 | + run: echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV |
| 151 | + |
| 152 | + - uses: softprops/action-gh-release@v1 |
| 153 | + with: |
| 154 | + name: tizen-embedder-${{ env.SHORT_SHA }} |
| 155 | + tag_name: ${{ env.SHORT_SHA }} |
| 156 | + target_commitish: ${{ github.sha }} |
| 157 | + files: tizen-*.zip |
| 158 | + body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
0 commit comments