From: Terry Burton Date: Fri, 19 Mar 2021 11:34:20 +0000 (+0000) Subject: CI: Combine steps for installing and configuring fixtures (#4003) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60a1cef6e66f8ae6ab770d55dd1c124dabc3c43a;p=thirdparty%2Ffreeradius-server.git CI: Combine steps for installing and configuring fixtures (#4003) Saves >20 secs. --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f45395ae6b1..a6aabcf3bb8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,28 +35,6 @@ jobs: needs: pre-ci if: ${{ needs.pre-ci.outputs.should_skip != 'true' }} -# -# Launching these containers takes the best part of a minute, so we configure -# the pre-installed, local instances of these services instead. -# -# services: -# mysql: -# image: mysql -# env: -# MYSQL_ALLOW_EMPTY_PASSWORD: yes -# ports: -# - 3306:3306 -# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -# -# postgres: -# image: postgres -# env: -# POSTGRES_HOST_AUTH_METHOD: trust -# ports: -# - 5432:5432 -# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 -# - runs-on: ${{ matrix.env.OS }} strategy: @@ -247,55 +225,38 @@ jobs: retention-days: 30 if: ${{ matrix.env.CC == 'clang' && failure() }} - - name: Install fixture (redis) - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | - sudo apt-get install -y --no-install-recommends redis-server redis-tools - sudo systemctl start redis-server - - - name: Install fixture (openldap) + - name: Install and setup fixtures then run full CI tests if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} run: | - sudo apt-get install -y --no-install-recommends slapd ldap-utils apparmor-utils - sudo systemctl stop slapd - sudo aa-complain /usr/sbin/slapd - # The sleep before stopping dovecot gives it time to produce the DH parameters file. - # Test dovecot instances don't run as root so if this file doesn't exist then there - # are permissions issues and the SSL instance of dovecot doesn't work - - name: Install fixture (dovecot imapd) - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | - sudo apt-get install -y --no-install-recommends dovecot-imapd + # Temporarily replace ucf (for config merge) with cp since it's + # terribly slow! + sudo sh -c 'echo "#!/bin/sh" > /usr/local/bin/ucf' + sudo sh -c 'echo "shift && cp -v \$@" >> /usr/local/bin/ucf' + sudo chmod +x /usr/local/bin/ucf + sudo apt-get install -y --no-install-recommends \ + apparmor-utils \ + dovecot-imapd \ + exim4 \ + redis-server redis-tools \ + slapd ldap-utils + sudo rm -f /usr/local/bin/ucf + + # Wait for Dovecot DH parameter creation before stopping the service while [ ! -f /var/lib/dovecot/ssl-parameters.dat ] ; do sleep 1 done - sudo systemctl stop dovecot - sudo aa-complain /usr/sbin/dovecot - - - name: Install fixture (exim) - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | - sudo apt-get install -y --no-install-recommends exim4 - sudo systemctl stop exim4 + sudo systemctl stop dovecot exim4 slapd + sudo aa-complain /usr/sbin/slapd - - name: Configure fixture (PostgreSQL) - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | export PG_VER=13 sudo sh -c "echo host all all 127.0.0.1/32 trust > /etc/postgresql/$PG_VER/main/pg_hba.conf" sudo sh -c "echo local all all trust >> /etc/postgresql/$PG_VER/main/pg_hba.conf" - sudo systemctl start postgresql - - name: Configure fixture (MySQL) - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | - sudo systemctl start mysql + sudo systemctl start mysql postgresql redis-server + mysql -h 127.0.0.1 -uroot -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '';"; - - name: Setup fixtures and run full CI tests - if: ${{ matrix.env.TEST_TYPE == 'fixtures' }} - run: | for i in \ postgresql-setup.sh \ imap-setup.sh \ @@ -308,7 +269,9 @@ jobs: echo "Calling $i" $script done + make ci-test + env: SMTP_TEST_SERVER: 127.0.0.1 SMTP_TEST_SERVER_PORT: 2525