-
Notifications
You must be signed in to change notification settings - Fork 178
98 lines (88 loc) · 3.25 KB
/
build-dev-docker.yml
File metadata and controls
98 lines (88 loc) · 3.25 KB
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
name: Build docker image for CI/CD infra on PR
on:
pull_request:
branches:
- master
paths:
- '.github/workflows/build-dev-docker.yml'
- 'infra/docker/**'
# Cancel previous running jobs when pull request is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
filtering:
runs-on: ubuntu-latest
outputs:
ubuntu-target: ${{ steps.ubuntu-filter.outputs.changes }}
android: ${{ steps.android-filter.outputs.android }}
steps:
- uses: dorny/paths-filter@v3
id: ubuntu-filter
with:
filters: |
focal:
- '.github/**'
- 'infra/docker/focal/Dockerfile'
jammy:
- '.github/**'
- 'infra/docker/jammy/Dockerfile'
noble:
- '.github/**'
- 'infra/docker/noble/Dockerfile'
- uses: dorny/paths-filter@v3
id: android-filter
with:
filters: |
android:
- '.github/**'
- 'infra/docker/android-sdk/**'
# Build on docker CLI for PR test without login
build-ubuntu:
needs: filtering
if: github.repository_owner == 'Samsung' && needs.filtering.outputs.ubuntu-target != '[]'
runs-on: one-x64-linux
strategy:
matrix:
version: ${{ fromJSON(needs.filtering.outputs.ubuntu-target) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build --file infra/docker/${{ matrix.version }}/Dockerfile --tag one-test .
- name: Test onert build
if: matrix.version != 'focal' # not supported
run: |
docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" one-test make -f Makefile.template
docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" one-test Product/out/test/onert-test unittest
- name: Download rootfs for cross build
uses: dawidd6/action-download-artifact@v7
if: matrix.version != 'focal' # not supported
with:
workflow: generate-rootfs.yml
branch: master
name: rootfs_arm_${{ matrix.version }}
# Workaround: symlink for rootfs checker in cmake toolchain file
- name: Install rootfs and cross build
if: matrix.version != 'focal' # not supported
run: |
mkdir -p tools/cross/rootfs
tar -zxf rootfs_arm_${{ matrix.version }}.tar.gz -C tools/cross/rootfs
pushd tools/cross/rootfs/arm
ln -sf usr/lib lib
popd
docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" -e CROSS_BUILD=1 -e TARGET_ARCH=armv7l one-test make -f Makefile.template
build-android:
needs: filtering
if: github.repository_owner == 'Samsung' && needs.filtering.outputs.android == 'true'
runs-on: one-x64-linux
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker Image
run: |
docker build --file infra/docker/android-sdk/Dockerfile --tag one-test .
- name: Test onert build
run: |
docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" -e CROSS_BUILD=1 -e TARGET_OS=android -e BUILD_TYPE=release one-test make -f Makefile.template