ci: bump actions to use ubuntu-24.04 #398
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: packaging | |
| on: [push, pull_request] | |
| jobs: | |
| # Run not only on tags, otherwise dependent job will skip. | |
| version-check: | |
| # Skip pull request job when the source branch is in the same | |
| # repository. | |
| if: | | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name != github.repository | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check module version | |
| # We need this step to run only on push with tag. | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
| uses: tarantool/actions/check-module-version@master | |
| with: | |
| module-name: 'smtp' | |
| build_package: | |
| # Skip pull request jobs when the source branch is in the same | |
| # repository. | |
| if: | | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name != github.repository | |
| needs: version-check | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - {os: debian, dist: bullseye} | |
| - {os: debian, dist: bookworm} | |
| - {os: ubuntu, dist: focal} | |
| - {os: ubuntu, dist: jammy} | |
| - {os: ubuntu, dist: noble} | |
| - {os: centos, dist: 8} | |
| - {os: fedora, dist: 34} | |
| - {os: fedora, dist: 35} | |
| - {os: fedora, dist: 36} | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Clone the module | |
| uses: actions/checkout@v4 | |
| with: | |
| # fetch-depth is 1 by default and it is okay for | |
| # building from a tag. However it is convenient to | |
| # have correct version for builds between tags too. | |
| fetch-depth: 0 | |
| - name: Clone packpack | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: packpack/packpack | |
| path: packpack | |
| - name: Build the package | |
| run: | | |
| export OS=${{ matrix.platform.os }} | |
| export DIST=${{ matrix.platform.dist }} | |
| ./packpack/packpack | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ format('{0}-{1}', matrix.platform.os, matrix.platform.dist) }} | |
| path: build | |
| retention-days: 21 | |
| test_package: | |
| # Skip pull request jobs when the source branch is in the same | |
| # repository. | |
| if: | | |
| github.event_name == 'push' || | |
| github.event.pull_request.head.repo.full_name != github.repository | |
| needs: [build_package] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: | |
| - {os: debian, dist: bullseye} | |
| - {os: debian, dist: bookworm} | |
| - {os: ubuntu, dist: jammy} | |
| - {os: ubuntu, dist: noble} | |
| - {os: centos, dist: 8} | |
| - {os: fedora, dist: 35} | |
| - {os: fedora, dist: 36} | |
| tarantool: | |
| # Verify on oldest and newest tarantool versions. | |
| # | |
| # It is important to verify both cases: when the module | |
| # uses the libcurl implementation provided by tarantool | |
| # executable and when the module falls back to the | |
| # system libcurl. | |
| - release/1.10.7 | |
| - release/2.11.6 | |
| exclude: | |
| # Tarantool 1.10.7 release is not supported on | |
| # debian:bullseye, ubuntu:jammy and fedora:34,35,36. | |
| - platform: {os: debian, dist: bullseye} | |
| tarantool: release/1.10.7 | |
| - platform: {os: debian, dist: bookworm} | |
| tarantool: release/1.10.7 | |
| - platform: {os: ubuntu, dist: jammy} | |
| tarantool: release/1.10.7 | |
| - platform: {os: ubuntu, dist: noble} | |
| tarantool: release/1.10.7 | |
| - platform: {os: fedora, dist: 35} | |
| tarantool: release/1.10.7 | |
| - platform: {os: fedora, dist: 36} | |
| tarantool: release/1.10.7 | |
| env: | |
| # Prevent packages like tzdata from asking configuration | |
| # parameters interactively. | |
| # See https://github.com/packpack/packpack/issues/7 | |
| DEBIAN_FRONTEND: noninteractive | |
| runs-on: ubuntu-24.04 | |
| container: ${{ format('{0}:{1}', matrix.platform.os, matrix.platform.dist) }} | |
| steps: | |
| # {{{ Distibution specific quirks | |
| - name: Use vault.centos.org repositories on CentOS 8 | |
| run: | | |
| # CentOS 8 reaches EOL 31 December 2021. | |
| # | |
| # The repositories that are configured in the container | |
| # are not working anymore. Use vault.centos.org package | |
| # archive instead. | |
| # | |
| # Related links: | |
| # | |
| # [1]: https://github.com/CentOS/sig-cloud-instance-images/issues/190 | |
| # [2]: https://bugs.centos.org/view.php?id=18394 | |
| # [3]: https://github.com/packpack/packpack-docker-images/pull/87 | |
| # [4]: https://github.com/tarantool/smtp/issues/60 | |
| find /etc/yum.repos.d/ -type f -exec sed -i 's/mirrorlist=/#mirrorlist=/g' {} + | |
| find /etc/yum.repos.d/ -type f -exec sed -i 's/#baseurl=/baseurl=/g' {} + | |
| find /etc/yum.repos.d/ -type f -exec sed -i 's/mirror.centos.org/vault.centos.org/g' {} + | |
| if: matrix.platform.os == 'centos' && matrix.platform.dist == 8 | |
| # }}} Distibution specific quirks | |
| # {{{ Install tarantool | |
| - name: Export T_* environment variables | |
| run: | | |
| # Split ${{ matrix.tarantool }}. | |
| T="${{ matrix.tarantool }}" | |
| T_KIND="${T%%/*}" | |
| T_VERSION="${T##*/}" | |
| if [ "${T_KIND}" = release ]; then | |
| T_SERIES="${T_VERSION%.*}" | |
| if [ "${T_SERIES}" = "2.10" ]; then | |
| T_SERIES="2" | |
| fi | |
| else | |
| T_SERIES="${T_VERSION}" | |
| fi | |
| # Make the variables available for the next steps. | |
| printf '%s=%s\n' T_KIND "${T_KIND}" >> "${GITHUB_ENV}" | |
| printf '%s=%s\n' T_VERSION "${T_VERSION}" >> "${GITHUB_ENV}" | |
| printf '%s=%s\n' T_SERIES "${T_SERIES}" >> "${GITHUB_ENV}" | |
| - name: Install requirements (Debian/Ubuntu) | |
| run: | | |
| apt-get update -y | |
| apt-get install -y curl | |
| if: matrix.platform.os == 'debian' || matrix.platform.os == 'ubuntu' | |
| - name: Setup tarantool ${{ env.T_SERIES }} repository | |
| run: | | |
| URL="https://tarantool.io/${T_KIND}/${T_SERIES}/installer.sh" | |
| curl -fsSL "${URL}" > installer.sh | |
| chmod a+x installer.sh | |
| ./installer.sh | |
| - name: Install tarantool ${{ matrix.tarantool }} (CentOS/Fedora) | |
| run: yum install -y "tarantool-${T_VERSION}*" | |
| if: matrix.platform.os == 'centos' || matrix.platform.os == 'fedora' | |
| - name: Install tarantool ${{ matrix.tarantool }} (Debian/Ubuntu) | |
| run: apt-get install -y "tarantool=${T_VERSION}*" | |
| if: matrix.platform.os == 'debian' || matrix.platform.os == 'ubuntu' | |
| - name: Verify tarantool version | |
| run: | | |
| # Workaround https://github.com/tarantool/tarantool/issues/4983 | |
| # Workaround https://github.com/tarantool/tarantool/issues/5040 | |
| tarantool -e "require('fiber').sleep(0) assert(_TARANTOOL:startswith('${T_VERSION}'), _TARANTOOL) os.exit()" | |
| # }}} Install tarantool | |
| - name: Download the module package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ format('{0}-{1}', matrix.platform.os, matrix.platform.dist) }} | |
| - name: Install the module from the package (CentOS/Fedora) | |
| run: | | |
| # Install all dependencies of the package and the | |
| # package itself. | |
| # | |
| # ${ARCH} is not strictly necessary here, just for | |
| # equivalence with the Debian/Ubuntu step. | |
| ARCH=$(rpm --eval '%{_arch}') | |
| yum install -y *.${ARCH}.rpm | |
| if: matrix.platform.os == 'centos' || matrix.platform.os == 'fedora' | |
| - name: Install the module from the package (Debian/Ubuntu) | |
| run: | | |
| # TODO: Install dependencies of the package. | |
| # | |
| # Now we're lucky: all dependencies are already there. | |
| # | |
| # Trick: ${ARCH} is to filter out the source package. | |
| ARCH=$(dpkg --print-architecture) | |
| dpkg -i *_${ARCH}.deb | |
| if: matrix.platform.os == 'debian' || matrix.platform.os == 'ubuntu' | |
| - name: Clone the module | |
| uses: actions/checkout@v4 | |
| - name: Run tests | |
| run: | | |
| tarantool test/smtp.test.lua |