-
Notifications
You must be signed in to change notification settings - Fork 175
103 lines (99 loc) · 4.69 KB
/
build_and_test.yml
File metadata and controls
103 lines (99 loc) · 4.69 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
99
100
101
102
103
name: "Build and Test"
on:
workflow_dispatch:
jobs:
regression:
runs-on: ubuntu-18.04
strategy:
matrix:
container-os: [centos-7, centos-8]
steps:
- uses: actions/checkout@v2
- name: Build ${{ matrix.container-os }} Docker
if: ${{ matrix.container-os == 'centos-7' }}
run: |
docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF
FROM centos:7
RUN rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
RUN yum install -y epel-release centos-release-scl
RUN yum groups mark install "Development Tools"
RUN yum groupinstall -y "Development Tools"
RUN yum install -y \
lcov uuid-devel readline-devel zlib-devel openssl-devel pam-devel \
libxml2-devel libxslt-devel openldap-devel tcl-devel tk-devel python-devel \
python3-devel lz4 lz4-devel cyrus-sasl-gssapi \
llvm-toolset-7 llvm-toolset-7-llvm-devel llvm5.0-devel \
libicu-devel e2fsprogs-devel selinux-policy systemd-devel \
libuuid-devel cppcheck \
perl-devel perl-ExtUtils-Embed perl-IPC-Run perl-Time-HiRes perl-Test-Simple
RUN localedef -i en_US -f UTF-8 en_US.UTF-8
RUN useradd -m -d /home/ivorysql ivorysql
EOF
- name: Build ${{ matrix.container-os }} Docker
if: ${{ matrix.container-os == 'centos-8' }}
run: |
docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF
FROM centos:8
RUN cd /etc/yum.repos.d/ && sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
RUN dnf install -y epel-release
RUN dnf groupinstall -y "Development Tools"
RUN dnf install -y \
llvm-toolset llvm-devel lz4 lz4-devel lz4-libs clang-devel \
krb5-devel libselinux-devel libxml2-devel cyrus-sasl-gssapi \
libicu-devel e2fsprogs-devel selinux-policy systemd-devel \
libxslt-devel openldap-devel openssl-devel pam-devel \
libuuid-devel python3-devel readline-devel tcl-devel zlib-devel \
perl perl-devel perl-ExtUtils-Embed
RUN dnf install -y --enablerepo=*ower*ools perl-IPC-Run perl-Time-HiRes perl-Test-Simple uuid-devel
RUN useradd -m -d /home/ivorysql ivorysql
EOF
- name: Create and Start iv-${{ matrix.container-os }}-container container
run: |
docker create -t -u ivorysql \
--name iv-${{ matrix.container-os }}-container \
-v ${GITHUB_WORKSPACE}:/IvorySQL:rw \
ivorysql-${{ matrix.container-os }} bash &&
docker start iv-${{ matrix.container-os }}-container
- name: configure - ${{ matrix.container-os }}
run: |
docker exec -u ivorysql \
iv-${{ matrix.container-os }}-container bash -c "
tar -c --exclude .git* -C / IvorySQL | tar -x -C /home/ivorysql/ &&
cd /home/ivorysql/IvorySQL &&
./configure \
--enable-cassert --enable-debug --enable-rpath --with-tcl \
--with-python --with-gssapi --with-pam --with-ldap \
--with-openssl --with-libedit-preferred --with-uuid=e2fs \
--with-ossp-uuid --with-libxml --with-libxslt --with-perl
"
- name: compile
run: |
docker exec -u ivorysql \
iv-${{ matrix.container-os }}-container bash -c "
cd /home/ivorysql/IvorySQL && make
"
- name: regression
run: |
docker exec -u ivorysql \
iv-${{ matrix.container-os }}-container bash -c "
cd /home/ivorysql/IvorySQL && make check-world
"
- name: collect files
if: failure()
run: |
docker exec -u 0 \
iv-${{ matrix.container-os }}-container bash -c "
cd /home/ivorysql/IvorySQL &&
find . \( -name \*.diffs -or -name regression.out -or -path \*/tmp_check/log \) -print0 |
xargs -0 tar -czf /IvorySQL/regression.tar.gz
"
- name: upload regression files
if: failure()
uses: actions/upload-artifact@v4
with:
name: results
path: ${{ github.workspace }}/regression.tar.gz
- name: Cleanup
if: always()
run: |
docker stop iv-${{ matrix.container-os }}-container