Skip to content

Commit

Permalink
Add compiler to build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBowman committed Jun 19, 2024
1 parent 4ffe517 commit f055bd0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Docker

on:
push:
# paths:
# - 'docker/**'
paths:
- 'docker/**'
workflow_dispatch:

env:
Expand All @@ -24,6 +24,9 @@ jobs:
matrix:
ubuntu: ['20.04', '22.04']
opencv: ['4.x']
compiler:
- { cmd: g++, label: gcc }
- { cmd: clang++, label: clang }

steps:
- name: Check out main project
Expand All @@ -47,8 +50,9 @@ jobs:
with:
push: true
context: docker
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:ubuntu-${{matrix.ubuntu}}-opencv-${{matrix.opencv}}
tags: ${{env.REGISTRY}}/${{env.IMAGE_NAME}}:ubuntu-${{matrix.ubuntu}}-opencv-${{matrix.opencv}}-${{matrix.compiler.label}}
labels: ${{steps.meta.outputs.labels}}
build-args: |
OPENCV_TAG=${{matrix.opencv}}
UBUNTU_TAG=${{matrix.ubuntu}}
COMPILER=${{matrix.compiler.cmd}}
13 changes: 12 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ ARG UBUNTU_TAG
FROM ubuntu:$UBUNTU_TAG

ARG OPENCV_TAG
ARG COMPILER

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y cmake g++ wget unzip && \
apt-get install -y \
${COMPILER} \
cmake \
wget \
unzip \
ccache \
libpcl-dev \
swig \
googletest && \
wget -O opencv.zip https://github.com/opencv/opencv/archive/${OPENCV_TAG}.zip && \
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/${OPENCV_TAG}.zip && \
unzip opencv.zip && \
Expand Down

0 comments on commit f055bd0

Please sign in to comment.