|
| 1 | +name: "Build and Test" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + regression: |
| 8 | + runs-on: ubuntu-18.04 |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + container-os: [centos-7, centos-8] |
| 12 | + |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Build ${{ matrix.container-os }} Docker |
| 16 | + if: ${{ matrix.container-os == 'centos-7' }} |
| 17 | + run: | |
| 18 | + docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF |
| 19 | + FROM centos:7 |
| 20 | + RUN rpm --import http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7 |
| 21 | + RUN yum install -y epel-release centos-release-scl |
| 22 | + RUN yum groups mark install "Development Tools" |
| 23 | + RUN yum groupinstall -y "Development Tools" |
| 24 | + RUN yum install -y \ |
| 25 | + lcov uuid-devel readline-devel zlib-devel openssl-devel pam-devel \ |
| 26 | + libxml2-devel libxslt-devel openldap-devel tcl-devel tk-devel python-devel \ |
| 27 | + python3-devel lz4 lz4-devel cyrus-sasl-gssapi \ |
| 28 | + llvm-toolset-7 llvm-toolset-7-llvm-devel llvm5.0-devel \ |
| 29 | + libicu-devel e2fsprogs-devel selinux-policy systemd-devel \ |
| 30 | + libuuid-devel cppcheck \ |
| 31 | + perl-devel perl-ExtUtils-Embed perl-IPC-Run perl-Time-HiRes perl-Test-Simple |
| 32 | + RUN localedef -i en_US -f UTF-8 en_US.UTF-8 |
| 33 | + RUN useradd -m -d /home/ivorysql ivorysql |
| 34 | + EOF |
| 35 | + - name: Build ${{ matrix.container-os }} Docker |
| 36 | + if: ${{ matrix.container-os == 'centos-8' }} |
| 37 | + run: | |
| 38 | + docker build -t ivorysql-${{ matrix.container-os }}:latest -<<EOF |
| 39 | + FROM centos:8 |
| 40 | + 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-* |
| 41 | + RUN dnf install -y epel-release |
| 42 | + RUN dnf groupinstall -y "Development Tools" |
| 43 | + RUN dnf install -y \ |
| 44 | + llvm-toolset llvm-devel lz4 lz4-devel lz4-libs clang-devel \ |
| 45 | + krb5-devel libselinux-devel libxml2-devel cyrus-sasl-gssapi \ |
| 46 | + libicu-devel e2fsprogs-devel selinux-policy systemd-devel \ |
| 47 | + libxslt-devel openldap-devel openssl-devel pam-devel \ |
| 48 | + libuuid-devel python3-devel readline-devel tcl-devel zlib-devel \ |
| 49 | + perl perl-devel perl-ExtUtils-Embed |
| 50 | + RUN dnf install -y --enablerepo=*ower*ools perl-IPC-Run perl-Time-HiRes perl-Test-Simple uuid-devel |
| 51 | + RUN useradd -m -d /home/ivorysql ivorysql |
| 52 | + EOF |
| 53 | + - name: Create and Start iv-${{ matrix.container-os }}-container container |
| 54 | + run: | |
| 55 | + docker create -t -u ivorysql \ |
| 56 | + --name iv-${{ matrix.container-os }}-container \ |
| 57 | + -v ${GITHUB_WORKSPACE}:/IvorySQL:rw \ |
| 58 | + ivorysql-${{ matrix.container-os }} bash && |
| 59 | + docker start iv-${{ matrix.container-os }}-container |
| 60 | + - name: configure - ${{ matrix.container-os }} |
| 61 | + run: | |
| 62 | + docker exec -u ivorysql \ |
| 63 | + iv-${{ matrix.container-os }}-container bash -c " |
| 64 | + tar -c --exclude .git* -C / IvorySQL | tar -x -C /home/ivorysql/ && |
| 65 | + cd /home/ivorysql/IvorySQL && |
| 66 | + ./configure \ |
| 67 | + --enable-cassert --enable-debug --enable-rpath --with-tcl \ |
| 68 | + --with-python --with-gssapi --with-pam --with-ldap \ |
| 69 | + --with-openssl --with-libedit-preferred --with-uuid=e2fs \ |
| 70 | + --with-ossp-uuid --with-libxml --with-libxslt --with-perl \ |
| 71 | + --with-icu |
| 72 | + " |
| 73 | + - name: compile |
| 74 | + run: | |
| 75 | + docker exec -u ivorysql \ |
| 76 | + iv-${{ matrix.container-os }}-container bash -c " |
| 77 | + cd /home/ivorysql/IvorySQL && make |
| 78 | + " |
| 79 | + - name: regression |
| 80 | + run: | |
| 81 | + docker exec -u ivorysql \ |
| 82 | + iv-${{ matrix.container-os }}-container bash -c " |
| 83 | + cd /home/ivorysql/IvorySQL && make check-world |
| 84 | + " |
| 85 | + - name: collect files |
| 86 | + if: failure() |
| 87 | + run: | |
| 88 | + docker exec -u 0 \ |
| 89 | + iv-${{ matrix.container-os }}-container bash -c " |
| 90 | + cd /home/ivorysql/IvorySQL && |
| 91 | + find . \( -name \*.diffs -or -name regression.out -or -path \*/tmp_check/log \) -print0 | |
| 92 | + xargs -0 tar -czf /IvorySQL/regression.tar.gz |
| 93 | + " |
| 94 | + - name: upload regression files |
| 95 | + if: failure() |
| 96 | + uses: actions/upload-artifact@v4 |
| 97 | + with: |
| 98 | + name: results |
| 99 | + path: ${{ github.workspace }}/regression.tar.gz |
| 100 | + |
| 101 | + - name: Cleanup |
| 102 | + if: always() |
| 103 | + run: | |
| 104 | + docker stop iv-${{ matrix.container-os }}-container |
0 commit comments