settings: Abstract default config settings to set_conf_default() #225
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish latest imaptest | |
| on: | |
| pull_request: | |
| push: | |
| paths: | |
| - 'src/**' | |
| - .github/workflows/static.yml | |
| workflow_dispatch: | |
| jobs: | |
| build_ubuntu_arm: | |
| needs: | |
| - build_ubuntu | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04-arm | |
| version: ubuntu-24.04 | |
| aliases: '["debian-13"]' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout imaptest | |
| uses: actions/checkout@v4 | |
| with: | |
| path: imaptest | |
| - name: Checkout dovecot | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: dovecot/core | |
| path: core | |
| - name: Install gettext (missing from GH Actions image) | |
| run: | | |
| sudo apt install -y gettext | |
| - name: Build dovecot libraries | |
| working-directory: ${{ github.workspace }}/core | |
| run: | | |
| autoreconf -vif | |
| env LIBPCRE_LIBS_STATIC=/usr/lib/$(uname -m)-linux-gnu/libpcre2-32.a SSL_LIBS="/usr/lib/$(uname -m)-linux-gnu/libssl.a /usr/lib/$(uname -m)-linux-gnu/libcrypto.a" ZLIB_LIBS_STATIC=/usr/lib/$(uname -m)-linux-gnu/libz.a ./configure | |
| make -j8 | |
| - name: Build imaptest | |
| working-directory: ${{ github.workspace }}/imaptest | |
| run: | | |
| autoreconf -vif | |
| env EXTRA_LIBS="/usr/lib/$(uname -m)-linux-gnu/libpcre2-32.a /usr/lib/$(uname -m)-linux-gnu/libssl.a /usr/lib/$(uname -m)-linux-gnu/libcrypto.a /usr/lib/$(uname -m)-linux-gnu/libz.a" ./configure --with-dovecot=../core | |
| make -j8 | |
| - name: Strip imaptest | |
| run: | | |
| strip --strip-all imaptest/src/imaptest | |
| - name: Rename artifact | |
| run: | | |
| for n in ${{ join(fromJSON(matrix.aliases), ' ') }}; do cp imaptest/src/imaptest "imaptest-$(uname -m)-$n"; done | |
| mv imaptest/src/imaptest imaptest-$(uname -m)-${{ matrix.version }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-aarch64-${{ matrix.version }} | |
| path: imaptest-aarch64-* | |
| build_ubuntu: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| image: ubuntu-24.04 | |
| aliases: '["debian-13"]' | |
| - os: ubuntu-22.04 | |
| image: ubuntu-22.04 | |
| aliases: '["debian-12"]' | |
| runs-on: ${{ matrix.image }} | |
| steps: | |
| - name: Checkout imaptest | |
| uses: actions/checkout@v4 | |
| with: | |
| path: imaptest | |
| - name: Checkout dovecot | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: dovecot/core | |
| path: core | |
| - name: Install gettext (missing from GH Actions image) | |
| run: | | |
| sudo apt install -y gettext | |
| - name: Build dovecot libraries | |
| working-directory: ${{ github.workspace }}/core | |
| run: | | |
| autoreconf -vif | |
| env LIBPCRE_LIBS_STATIC=/usr/lib/$(uname -m)-linux-gnu/libpcre2-32.a SSL_LIBS="/usr/lib/$(uname -m)-linux-gnu/libssl.a /usr/lib/$(uname -m)-linux-gnu/libcrypto.a" ZLIB_LIBS_STATIC=/usr/lib/$(uname -m)-linux-gnu/libz.a ./configure --enable-experimental-mail-utf8 | |
| make -j8 | |
| - name: Fix dynamic library dependencies | |
| working-directory: ${{ github.workspace }}/core | |
| run: | | |
| cp src/lib-compression/libcompression.la src/lib-compression/libcompression.la.bak | |
| cp src/lib-dovecot/libdovecot.la src/lib-dovecot/libdovecot.la.bak | |
| sed -i -e "s,dependency_libs=.*,dependency_libs=''," src/lib-compression/libcompression.la | |
| sed -i -e "s,dependency_libs=.*,dependency_libs='-lm'," src/lib-dovecot/libdovecot.la | |
| - name: Build imaptest | |
| working-directory: ${{ github.workspace }}/imaptest | |
| run: | | |
| autoreconf -vif | |
| env EXTRA_LIBS="/usr/lib/$(uname -m)-linux-gnu/libpcre2-32.a /usr/lib/$(uname -m)-linux-gnu/libssl.a /usr/lib/$(uname -m)-linux-gnu/libcrypto.a /usr/lib/$(uname -m)-linux-gnu/libz.a" ./configure --with-dovecot=../core | |
| make -j8 | |
| - name: Setup dovecot for testing | |
| working-directory: ${{ github.workspace }}/core | |
| run: | | |
| mv src/lib-compression/libcompression.la.bak src/lib-compression/libcompression.la | |
| mv src/lib-dovecot/libdovecot.la.bak src/lib-dovecot/libdovecot.la | |
| sudo make install | |
| cat <<EOF | sudo tee /usr/local/etc/dovecot/dovecot.conf | |
| dovecot_config_version = 0.0.0 | |
| dovecot_storage_version = 2.4.0 | |
| mail_home = /tmp/home | |
| mail_path = ~/mail | |
| mail_driver = maildir | |
| protocols = imap | |
| default_internal_user = runner | |
| default_login_user = runner | |
| default_internal_group = runner | |
| mail_uid = runner | |
| mail_gid = runner | |
| passdb static { | |
| password = swordfish | |
| } | |
| mail_utf8_extensions = yes | |
| EOF | |
| - name: Test imaptest | |
| run: | | |
| sudo dovecot | |
| mkdir ~/mail/ | |
| curl --location https://www.dovecot.org/res/dovecot.mbox > ~/mail/dovecot-crlf | |
| env PATH=$PATH:$PWD/imaptest/src run-parts imaptest/tests | |
| sudo dovecot stop | |
| - name: Strip imaptest | |
| run: | | |
| strip --strip-all imaptest/src/imaptest | |
| - name: Rename artifact | |
| run: | | |
| for n in ${{ join(fromJSON(matrix.aliases), ' ') }}; do cp imaptest/src/imaptest "imaptest-$(uname -m)-$n"; done | |
| mv imaptest/src/imaptest imaptest-$(uname -m)-${{ matrix.os }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-x86_64-${{ matrix.os }} | |
| path: imaptest-x86_64-* | |
| build_rhel: | |
| needs: | |
| - build_ubuntu | |
| strategy: | |
| matrix: | |
| include: | |
| - os: rhel8 | |
| container: registry.access.redhat.com/ubi8/ubi | |
| stream: https://vault.centos.org/8-stream | |
| aliases: '["debian-11","ubuntu-20.04"]' | |
| - os: rhel9 | |
| container: registry.access.redhat.com/ubi9/ubi | |
| stream: https://mirror.stream.centos.org/9-stream/ | |
| aliases: '[]' | |
| - os: rhel10 | |
| container: registry.access.redhat.com/ubi10/ubi | |
| stream: https://mirror.stream.centos.org/10-stream/ | |
| aliases: '[]' | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ matrix.container }} | |
| steps: | |
| - name: Checkout imaptest | |
| uses: actions/checkout@v4 | |
| with: | |
| path: imaptest | |
| - name: Checkout dovecot | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: dovecot/core | |
| path: core | |
| - name: Install build dependencies | |
| run: | | |
| dnf makecache | |
| dnf install -y gcc gcc-c++ make automake autoconf libtool pkgconf-pkg-config gettext zlib-devel openssl-devel autoconf-archive diffutils file wget git perl-version python3 | |
| - name: Add repositories | |
| run: | | |
| cat <<EOF > /etc/yum.repos.d/stream.repo | |
| [${{ matrix.os }}-stream_baseos] | |
| name = ${{ matrix.os }} - stream baseos | |
| baseurl = ${{ matrix.stream }}/BaseOS/x86_64/os | |
| gpgcheck = 0 | |
| enabled = 1 | |
| [${{ matrix.so }}-stream_appstream] | |
| name = ${{ matrix.os }} - stream appstream | |
| baseurl = ${{ matrix.stream }}/AppStream/x86_64/os | |
| gpgcheck = 0 | |
| enabled = 1 | |
| EOF | |
| - name: Install more build dependencies | |
| run: | | |
| dnf makecache | |
| dnf install -y gettext-devel bison flex | |
| - name: Force-enable pic | |
| run: | | |
| sed -s -i -e 's/LT_INIT/LT_INIT([pic-only])/' core/configure.ac | |
| - name: Build dovecot libraries | |
| working-directory: ${{ github.workspace }}/core | |
| run: | | |
| env VERSION=0.0.0 autoreconf -vif | |
| ./configure | |
| make -j8 | |
| - name: Build imaptest | |
| working-directory: ${{ github.workspace }}/imaptest | |
| run: | | |
| env VERSION=0.0.0 autoreconf -vif | |
| ./configure --with-dovecot=../core | |
| make -j8 | |
| - name: Strip imaptest | |
| run: | | |
| strip --strip-all imaptest/src/imaptest | |
| - name: Rename artifact | |
| run: | | |
| for n in ${{ join(fromJSON(matrix.aliases), ' ') }}; do cp imaptest/src/imaptest "imaptest-$(uname -m)-$n"; done | |
| mv imaptest/src/imaptest imaptest-$(uname -m)-${{ matrix.os }} | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-x86_64-${{ matrix.os }} | |
| path: imaptest-x86_64-* | |
| publish: | |
| if: ${{ github.repository == 'dovecot/imaptest' && github.ref == 'refs/heads/main' }} | |
| needs: | |
| - build_ubuntu_arm | |
| - build_ubuntu | |
| - build_rhel | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download items | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: build | |
| merge-multiple: true | |
| - name: List files | |
| run: | | |
| find | |
| - name: Generate SHA256SUMS.txt | |
| working-directory: build | |
| run: | | |
| sha256sum imaptest-* > SHA256SUMS.txt | |
| - name: Update latest Release | |
| uses: andelf/nightly-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: latest | |
| name: 'ImapTest Latest Release' | |
| draft: false | |
| body: | | |
| ImapTest semi-static builds. These work on most machines with matching | |
| libc. These usually work with Debian as well. | |
| files: | | |
| build/imaptest-* | |
| build/SHA256SUMS.txt | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: dovecot/imaptest:latest |