-
Notifications
You must be signed in to change notification settings - Fork 1
187 lines (176 loc) · 6.39 KB
/
build_dev.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: ci-build-deploy
on:
push:
branches:
- "main"
schedule:
- cron: 0 0 * * 0
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
project:
[
"hdl",
"sw",
"libiio-debian-bullseye",
"libiio-ubuntu-18.04",
"libiio-ubuntu-20.04",
"libiio-ubuntu-22.04",
"libiio-fedora-34",
"libiio-fedora-28",
"libiio-centos-7",
"libiio-opensuse-15.4",
"test-harness",
"pyadi-iio-python-3_7",
"pyadi-iio-python-3_8",
"pyadi-iio-python-3_9",
"pyadi-iio-python-3_10",
"pyadi-iio-python-3_11",
"dev",
]
include:
- project: "hdl"
DOCKERFILE: "Dockerfile-hdl"
TAG_ROOT: "hdl-ci"
- project: "sw"
DOCKERFILE: "Dockerfile-sw"
TAG_ROOT: "sw-ci"
- project: "libiio-ubuntu-18.04"
DOCKERFILE: "libiio/Dockerfile-ubuntu-18.04"
TAG_ROOT: "libiio_ubuntu_18_04-ci"
- project: "libiio-ubuntu-20.04"
DOCKERFILE: "libiio/Dockerfile-ubuntu-20.04"
TAG_ROOT: "libiio_ubuntu_20_04-ci"
- project: "libiio-ubuntu-22.04"
DOCKERFILE: "libiio/Dockerfile-ubuntu-22.04"
TAG_ROOT: "libiio_ubuntu_22_04-ci"
- project: "libiio-fedora-34"
DOCKERFILE: "libiio/Dockerfile-fedora-34"
TAG_ROOT: "libiio_fedora_34-ci"
- project: "libiio-debian-bullseye"
DOCKERFILE: "libiio/Dockerfile-debian-bullseye"
TAG_ROOT: "libiio_debian_bullseye-ci"
- project: "libiio-debian-bookworm"
DOCKERFILE: "libiio/Dockerfile-debian-bookworm"
TAG_ROOT: "libiio_debian_bookworm-ci"
- project: "libiio-fedora-28"
DOCKERFILE: "libiio/Dockerfile-fedora-28"
TAG_ROOT: "libiio_fedora_28-ci"
- project: "libiio-centos-7"
DOCKERFILE: "libiio/Dockerfile-centos-7"
TAG_ROOT: "libiio_centos_7-ci"
- project: "libiio-opensuse-15.4"
DOCKERFILE: "libiio/Dockerfile-opensuse-15.4"
TAG_ROOT: "libiio_opensuse_15_4-ci"
- project: "test-harness"
DOCKERFILE: "test-harness/Dockerfile-test-harness"
TAG_ROOT: "test-harness-ci"
- project: "pyadi-iio-python-3_7"
DOCKERFILE: "pyadi-iio/Dockerfile-python-3_7"
TAG_ROOT: "pyadi-iio-python-3_7-ci"
- project: "pyadi-iio-python-3_8"
DOCKERFILE: "pyadi-iio/Dockerfile-python-3_8"
TAG_ROOT: "pyadi-iio-python-3_8-ci"
- project: "pyadi-iio-python-3_9"
DOCKERFILE: "pyadi-iio/Dockerfile-python-3_9"
TAG_ROOT: "pyadi-iio-python-3_9-ci"
- project: "pyadi-iio-python-3_10"
DOCKERFILE: "pyadi-iio/Dockerfile-python-3_10"
TAG_ROOT: "pyadi-iio-python-3_10-ci"
- project: "pyadi-iio-python-3_11"
DOCKERFILE: "pyadi-iio/Dockerfile-python-3_11"
TAG_ROOT: "pyadi-iio-python-3_11-ci"
- project: "dev"
DOCKERFILE: "Dockerfile-dev"
TAG_ROOT: "dev"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to the GitHub Container registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker images
id: docker_build
uses: docker/[email protected]
with:
file: ${{ matrix.DOCKERFILE }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
tfcollins/${{ matrix.TAG_ROOT }}:latest
ghcr.io/sdgtt/dockerfiles/${{ matrix.TAG_ROOT }}:latest
docker_arm:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
project: ["libiio-ubuntu-18.04", "libiio-debian-bullseye"]
include:
- project: "libiio-ubuntu-18.04"
DOCKERFILE: "libiio/Dockerfile-ubuntu-18.04"
TAG_ROOT: "libiio_ubuntu_18_04-ci-arm-ppc"
ARCH: linux/arm64
REFERENCE_IMAGE: "ubuntu:18.04"
- project: "libiio-debian-bullseye"
DOCKERFILE: "libiio/Dockerfile-debian-bullseye"
TAG_ROOT: "libiio_debian_bullseye-ci-arm-ppc"
ARCH: linux/arm64
REFERENCE_IMAGE: "debian:bullseye"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to DockerHub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm,arm64,ppc64le,s390x
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
driver: docker-container
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Test build
run: |
cp Dockerfile-arm Dockerfile
docker buildx create --name armbuilder
docker buildx use armbuilder
docker buildx build --builder armbuilder -t test_${{ matrix.TAG_ROOT }} --platform linux/arm64 --load .
ARCH_CHECK=$(docker run --platform linux/arm64 test_${{ matrix.TAG_ROOT }}:latest uname -a)
echo "$ARCH_CHECK"
echo "$ARCH_CHECK" | grep -i aarch64 || exit 1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: tfcollins/${{ matrix.TAG_ROOT }}:latest
file: Dockerfile-arm
context: .
platforms: linux/arm,linux/arm64,linux/ppc64le,linux/s390x