Commit f25ca0e3a59a31539628a7b5b61967bbbbcb3f96

Edward Thomson 2021-08-15T17:53:44

Merge pull request #5992 from libgit2/ethomson/centos_ci ci: add centos 7 and centos 8

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f0e9da9..d1a0be7 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -43,6 +43,8 @@ jobs:
           dockerfile: bionic
           base: multiarch/ubuntu-core:arm64-bionic
           qemu: true
+        - name: centos7
+        - name: centos8
     runs-on: ubuntu-latest
     steps:
     - name: Check out repository
diff --git a/ci/docker/centos7 b/ci/docker/centos7
new file mode 100644
index 0000000..7164583
--- /dev/null
+++ b/ci/docker/centos7
@@ -0,0 +1,39 @@
+ARG BASE=centos:7
+FROM ${BASE} AS yum
+RUN yum install -y \
+	which \
+	git \
+	libarchive \
+	cmake \
+	gcc \
+	gcc-c++ \
+	make \
+	openssl-devel \
+	openssh-server \
+	git-daemon \
+	java-1.8.0-openjdk-headless \
+	sudo \
+	python
+
+FROM yum AS libssh2
+RUN cd /tmp && \
+    curl https://libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \
+    cd libssh2-1.8.0 && \
+    ./configure && \
+    make && \
+    make install
+
+FROM libssh2 AS cmake
+RUN cd /tmp && \
+    curl -L https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1.tar.gz | tar -xz && \
+    cd cmake-3.21.1 && \
+    ./configure && \
+    make && \
+    make install
+
+FROM libssh2 AS adduser
+RUN useradd --shell /bin/bash libgit2 --create-home
+
+FROM adduser AS configure
+ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
+RUN mkdir /var/run/sshd
diff --git a/ci/docker/centos8 b/ci/docker/centos8
new file mode 100644
index 0000000..0414838
--- /dev/null
+++ b/ci/docker/centos8
@@ -0,0 +1,30 @@
+ARG BASE=centos:8
+FROM ${BASE} AS yum
+RUN yum install -y \
+	which \
+	git \
+	libarchive \
+	cmake \
+	gcc \
+	make \
+	openssl-devel \
+	openssh-server \
+	git-daemon \
+	java-1.8.0-openjdk-headless \
+	sudo \
+	python39
+
+FROM yum AS libssh2
+RUN cd /tmp && \
+    curl https://libssh2.org/download/libssh2-1.8.0.tar.gz | tar -xz && \
+    cd libssh2-1.8.0 && \
+    ./configure && \
+    make && \
+    make install
+
+FROM libssh2 AS adduser
+RUN useradd --shell /bin/bash libgit2 --create-home
+
+FROM adduser AS configure
+ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
+RUN mkdir /var/run/sshd