Skip to content

make fetching distro info more reliable #493

make fetching distro info more reliable

make fetching distro info more reliable #493

Workflow file for this run

name: Passenger CI tests
env:
FORCE_COLOR: 1
RUST_LOG_STYLE: always
DEFAULT_RUBY_VERSION: 3.1
BUNDLE_CLEAN: true
USE_ASAN: true
on:
push: {}
jobs:
cxx-linux:
name: C++ tests on Linux
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
EXTRA_CFLAGS: '-fdiagnostics-color'
EXTRA_CXXFLAGS: '-fdiagnostics-color'
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: sccache/cxx-ubuntu
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: x86_64-unknown-linux-musl
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup dependencies
run: |
sudo apt update
sudo apt install -y gdb libcurl4-openssl-dev
timeout-minutes: 2
- name: Setup misc
run: |
set -x
sudo chmod 755 "$HOME"
cp test/config.json.github-ci-linux test/config.json
- name: Build C++ tests
run: bundle exec drake -j4 test:cxx:build
timeout-minutes: 5
- name: Run C++ tests
# The AbortHandler doesn't work so well on Github's Linux runners:
# - Triggering the original signal handler makes the runner freeze, so we force
# terminate the process.
# - force killing the process may not work, so we enforce a low timeout to prevent
# the test from haging for a long time. We enforce this primarily using the 'timeout'
# command from coreutils instead of Github Actions' timeout, because the latter
# could put the entire job in the "skipped" state and refuse to show logs.
run: >
sudo env
PATH="$PATH"
GEM_PATH="$GEM_PATH"
PASSENGER_DUMP_CRASH_WATCH_TO_STDERR=true
PASSENGER_FORCE_TERMINATE_ON_ABORT=true
/usr/bin/timeout --signal KILL --verbose 540
../buildout/test/cxx/main
timeout-minutes: 10
working-directory: test
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: cxx-test-logs-linux
path: 'buildout/testlogs/*'
if-no-files-found: ignore
if: '!cancelled()'
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
cxx-linux-valgrind:
name: C++ tests on Valgrind
runs-on: ubuntu-24.04
timeout-minutes: 10
env:
USE_ASAN: false
EXTRA_CFLAGS: '-fdiagnostics-color'
EXTRA_CXXFLAGS: '-fdiagnostics-color'
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: sccache/cxx-ubuntu-valgrind
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: x86_64-unknown-linux-musl
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup dependencies
run: |
sudo apt update
sudo apt install -y valgrind gdb libcurl4-openssl-dev
timeout-minutes: 2
- name: Setup misc
run: |
set -x
sudo chmod 755 "$HOME"
cp test/config.json.github-ci-linux test/config.json
- name: Build C++ tests
run: bundle exec drake -j4 test:cxx:build
timeout-minutes: 5
- name: Run C++ tests
run: >
sudo env
PATH="$PATH"
GEM_PATH="$GEM_PATH"
PASSENGER_ABORT_HANDLER=false
/usr/bin/timeout --signal KILL --verbose 540
valgrind
--error-exitcode=1
--child-silent-after-fork=yes
--leak-check=full
--show-leak-kinds=definite
--errors-for-leak-kinds=none
--log-file=../valgrind.log.%p
../buildout/test/cxx/main
timeout-minutes: 10
working-directory: test
- name: Preprocess Valgrind logs
run: |
set -o pipefail
shopt -s nullglob
for LOGFILE in valgrind.log.*; do
# Remove PID prefixes
sed -E -i 's|^==[0-9]+== ||' "$LOGFILE"
# Delete all files containing only the Valgrind intro message.
# Don't take into account complaints about closeAllFileDescriptors()
# closing arbitrary file descriptors because the test suite spawns a
# lot of subprocesses that call that function first.
LINES=$(grep -vE 'invalid file descriptor .*? in syscall close|Use --log-fd' "$LOGFILE" | wc -l | awk '{ print $1 }')
if [[ "$LINES" -le 6 ]]; then
echo "Deleting $LOGFILE"
rm "$LOGFILE"
fi
done
if: '!cancelled()'
- name: Print Valgrind logs
run: |
shopt -s nullglob
for LOGFILE in valgrind.log.*; do
ERROR_SUMMARY=$(grep 'ERROR SUMMARY' "$LOGFILE" | cut -d':' -f2-)
echo "::group::${LOGFILE} — ${ERROR_SUMMARY}"
cat "$LOGFILE"
echo "::endgroup::"
done
if: '!cancelled()'
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: cxx-test-logs-valgrind
path: 'buildout/testlogs/*'
if-no-files-found: ignore
if: '!cancelled()'
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
cxx-macos:
name: C++ tests on macOS
runs-on: macos-14
timeout-minutes: 10
env:
EXTRA_CFLAGS: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
EXTRA_CXXFLAGS: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: sccache/cxx-macos-14-arm
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: aarch64-apple-darwin
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup dependencies
run: brew install coreutils
timeout-minutes: 1
- name: Setup misc
run: |
sudo chmod 755 "$HOME"
sed "s|_USER_|$(whoami)|" test/config.json.github-ci-macos > test/config.json
- name: Build C++ tests
run: bundle exec drake -j4 test:cxx:build
timeout-minutes: 5
- name: Run C++ tests
# The AbortHandler doesn't work so well on Github's macOS runners:
# - resuming the parent process after SIGSTOP doesn't work, so we force kill the parent.
# - force killing the parent may not work, so we enforce a low timeout to prevent
# the test from haging for a long time. We enforce this primarily using the 'timeout'
# command from coreutils instead of Github Actions' timeout, because the latter
# could put the entire job in the "skipped" state and refuse to show logs.
run: >
sudo env
PATH="$PATH"
GEM_PATH="$GEM_PATH"
PASSENGER_DUMP_CRASH_WATCH_TO_STDERR=true
PASSENGER_FORCE_TERMINATE_ON_ABORT=true
gtimeout --signal KILL --verbose 540
../buildout/test/cxx/main
timeout-minutes: 10
working-directory: test
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: cxx-test-logs-macos
path: 'buildout/testlogs/*'
if-no-files-found: ignore
if: '!cancelled()'
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
apache2:
name: "Apache2 tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
config_file: test/config.json.github-ci-linux
extra_cflags: '-fdiagnostics-color'
address_sanitizer: true
sccache_arch_and_os: x86_64-unknown-linux-musl
sccache_azure_key_prefix: sccache/cxx-ubuntu-24.04-x86_64
- name: macOS
os: macos-14
config_file: test/config.json.github-ci-macos
extra_cflags: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
# Using AddressSanitizer on dynamically loaded modules (like Apache modules)
# requires loading Apache with the AddressSanitizer runtime using DYLD_INSERT_LIBRARIES.
# That in turn requires disabling SIP, which is not possible on Github Actions.
address_sanitizer: false
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
EXTRA_CFLAGS: ${{ matrix.extra_cflags }}
EXTRA_CXXFLAGS: ${{ matrix.extra_cflags }}
USE_ASAN: ${{ matrix.address_sanitizer }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
SCCACHE_CACHE_MULTIARCH: true
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- uses: actions/setup-node@v4
timeout-minutes: 1
with:
node-version: 18
cache: npm
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup misc
run: |
sudo chmod 755 "$HOME"
sed "s|_USER_|$(whoami)|; s|_SOURCE_ROOT_|$(pwd)|" ${{ matrix.config_file }} > test/config.json
- name: Setup Linux dependencies
run: |
sudo apt update
sudo apt install -y libcurl4-openssl-dev apache2-dev libapr1-dev libaprutil1-dev
if: matrix.name == 'Linux'
timeout-minutes: 2
- name: Setup macOS code signing
run: |
exec 2>&1
set -x
# Create certificate
echo "$OPENSSL_CONFIG" > cert_config.cnf
openssl req -new -newkey rsa:2048 -nodes -keyout github-ci.key -out github-ci.csr -config cert_config.cnf
openssl x509 -req -in github-ci.csr -signkey github-ci.key -out github-ci.crt -days 3650 -extensions req_ext -extfile cert_config.cnf
# Throw-away keychain
sudo security authorizationdb write com.apple.trust-settings.admin allow
security create-keychain -p mypassword mykeychain.keychain
security set-keychain-settings -lut 21600 mykeychain.keychain
security unlock-keychain -p mypassword mykeychain.keychain
# Import & trust key
security import github-ci.key -k mykeychain.keychain -A
security set-key-partition-list -S apple-tool:,apple: -k mypassword mykeychain.keychain
sudo security add-trusted-cert -d -r trustRoot -k mykeychain.keychain github-ci.crt
security list-keychain -d user -s mykeychain.keychain
if: matrix.name == 'macOS'
# Sometimes `security add-trusted-cert` freezes indefinitelyl
timeout-minutes: 1
env:
OPENSSL_CONFIG: |
[ req ]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = req_distinguished_name
req_extensions = req_ext
[ req_distinguished_name ]
CN = Github CI
[ req_ext ]
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage = codeSigning
- name: Setup hosts entries
run: |
echo 127.0.0.1 passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test | sudo tee -a /etc/hosts
- run: npm ci
timeout-minutes: 2
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Test module installation as normal user
run: ./bin/passenger-install-apache2-module --auto --force-colors --rake-command 'bundle exec drake -j4'
timeout-minutes: 5
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
- name: Setup sccache as root
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
SUDO: true
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Test module installation as root
run: sudo -E ./bin/passenger-install-apache2-module --auto --force-colors --no-compile
timeout-minutes: 1
- name: Teardown sccache as root
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
env:
SUDO: true
- name: Integration tests
run: bundle exec rake test:integration:apache2
timeout-minutes: 2
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: apache-test-logs-${{ matrix.os }}
path: 'buildout/testlogs/*'
if-no-files-found: ignore
if: '!cancelled()'
nginx:
name: "Nginx tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
config_file: test/config.json.github-ci-linux
extra_cflags: '-fdiagnostics-color'
sccache_arch_and_os: x86_64-unknown-linux-musl
sccache_azure_key_prefix: sccache/cxx-ubuntu-24.04-x86_64
- name: macOS
os: macos-14
config_file: test/config.json.github-ci-macos
extra_cflags: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.os }}
env:
EXTRA_CFLAGS: ${{ matrix.extra_cflags }}
EXTRA_CXXFLAGS: ${{ matrix.extra_cflags }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- uses: actions/setup-node@v4
timeout-minutes: 1
with:
node-version: 18
cache: npm
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup misc
run: |
sudo chmod 755 "$HOME"
sed "s|_USER_|$(whoami)|" ${{ matrix.config_file }} > test/config.json
- name: Setup Linux dependencies
run: |
sudo apt update
sudo apt install -y libcurl4-openssl-dev
if: matrix.name == 'Linux'
timeout-minutes: 2
- name: Setup hosts entries
run: |
echo 127.0.0.1 passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test | sudo tee -a /etc/hosts
echo 127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test | sudo tee -a /etc/hosts
- run: npm ci
timeout-minutes: 2
- name: Test installation
run: >
./bin/passenger-install-nginx-module
--auto
--force-colors
--prefix=/tmp/nginx
--auto-download
--rake-command 'bundle exec drake -j4'
--make-concurrency 4
timeout-minutes: 5
- name: Integration tests
run: bundle exec rake test:integration:nginx
timeout-minutes: 2
- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: nginx-test-logs-${{ matrix.os }}
path: 'buildout/testlogs/*'
if-no-files-found: ignore
if: '!cancelled()'
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
nginx_dynamic:
name: "Nginx dynamic module tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
extra_cflags: '-fdiagnostics-color'
sccache_arch_and_os: x86_64-unknown-linux-musl
sccache_azure_key_prefix: sccache/cxx-ubuntu-24.04-x86_64
- name: macOS
os: macos-14
extra_cflags: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.os }}
env:
EXTRA_CFLAGS: ${{ matrix.extra_cflags }}
EXTRA_CXXFLAGS: ${{ matrix.extra_cflags }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup Linux dependencies
run: |
sudo apt update
sudo apt install -y libcurl4-openssl-dev
if: matrix.name == 'Linux'
timeout-minutes: 2
- name: Setup parameters
run: |
TEST_DYNAMIC_WITH_NGINX_VERSION=$(ruby -r "./src/ruby_supportlib/phusion_passenger.rb" -e 'puts PhusionPassenger::PREFERRED_NGINX_VERSION')
NGINX_ADDON_DIR=$(./bin/passenger-config --nginx-addon-dir)
echo "TEST_DYNAMIC_WITH_NGINX_VERSION=$TEST_DYNAMIC_WITH_NGINX_VERSION" >> "$GITHUB_ENV"
echo "NGINX_ADDON_DIR=$NGINX_ADDON_DIR" >> "$GITHUB_ENV"
- name: Compile module
run: bundle exec drake -j4 nginx:as_dynamic_module
timeout-minutes: 5
- name: Download Nginx source
run: curl -sSLO "https://www.nginx.org/download/nginx-$TEST_DYNAMIC_WITH_NGINX_VERSION.tar.gz"
timeout-minutes: 1
- name: Extract Nginx source
run: tar -xzf "nginx-$TEST_DYNAMIC_WITH_NGINX_VERSION.tar.gz"
timeout-minutes: 1
- name: Configure Nginx source
run: ./configure --with-cc-opt='-Wno-error' --add-dynamic-module="$NGINX_ADDON_DIR"
timeout-minutes: 1
working-directory: "nginx-${{ env.TEST_DYNAMIC_WITH_NGINX_VERSION }}"
- name: Compile Nginx with dynamic module
run: make -j4
timeout-minutes: 2
working-directory: "nginx-${{ env.TEST_DYNAMIC_WITH_NGINX_VERSION }}"
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
standalone:
name: "Passenger Standalone tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
extra_cflags: '-fdiagnostics-color'
sccache_arch_and_os: x86_64-unknown-linux-musl
sccache_azure_key_prefix: sccache/cxx-ubuntu-24.04-x86_64
- name: macOS
os: macos-14
extra_cflags: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
EXTRA_CFLAGS: ${{ matrix.extra_cflags }}
EXTRA_CXXFLAGS: ${{ matrix.extra_cflags }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup Linux dependencies
run: |
sudo apt update
sudo apt install -y libcurl4-openssl-dev
if: matrix.name == 'Linux'
timeout-minutes: 2
- name: Compile prerequisites
run: bundle exec drake -j4 nginx
timeout-minutes: 5
- name: Integration test
run: bundle exec drake -j4 test:integration:standalone
timeout-minutes: 8
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
ruby:
name: "Ruby tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
config_file: test/config.json.github-ci-linux
extra_cflags: '-fdiagnostics-color'
sccache_arch_and_os: x86_64-unknown-linux-musl
sccache_azure_key_prefix: sccache/cxx-ubuntu-24.04-x86_64
- name: macOS
os: macos-14
config_file: test/config.json.github-ci-macos
extra_cflags: '-I/opt/homebrew/opt/openssl@3/include -fcolor-diagnostics'
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.os }}
timeout-minutes: 10
env:
EXTRA_CFLAGS: ${{ matrix.extra_cflags }}
EXTRA_CXXFLAGS: ${{ matrix.extra_cflags }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Setup misc
run: |
sudo chmod 755 "$HOME"
sed "s|_USER_|$(whoami)|" ${{ matrix.config_file }} > test/config.json
- name: Setup Linux dependencies
run: |
sudo apt update
sudo apt install -y libcurl4-openssl-dev
if: matrix.name == 'Linux'
timeout-minutes: 2
- name: Compile
run: bundle exec drake -j4 agent
timeout-minutes: 5
- name: Test
run: bundle exec rake test:ruby
timeout-minutes: 2
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: '!cancelled()'
nodejs:
name: "Node.js tests on ${{ matrix.name }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-24.04
- name: macOS
os: macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- uses: actions/setup-node@v4
timeout-minutes: 1
with:
node-version: 18
cache: npm
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- run: npm ci
timeout-minutes: 2
- name: Test
run: bundle exec rake test:node
timeout-minutes: 2
homebrew_packaging:
name: Homebrew packaging tests
runs-on: macos-14
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Create tarball
run: bundle exec rake package:set_official package:tarball
timeout-minutes: 1
- name: Check whether formula is up-to-date
run: >
./packaging/homebrew/verify-oss-formula-uptodate
-c homebrew-core.git
-r upstream
timeout-minutes: 5
- name: Modify formula
run: >
./packaging/homebrew/modify-formula
--passenger-dir .
--formula packaging/homebrew/Formula/passenger.rb
--tarball pkg/*.tar.gz
--output pkg/passenger.rb
timeout-minutes: 1
- name: Test formula
run: >
./packaging/homebrew/test-formula
-p .
-f pkg/passenger.rb
-t pkg/*.tar.gz
timeout-minutes: 6
source_packaging:
name: Source packaging tests
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
timeout-minutes: 1
with:
submodules: true
- uses: ruby/setup-ruby@v1
timeout-minutes: 2
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true
- name: Setup bundle gem path
run: ./dev/ci/setup-bundle-gem-path
- name: Test
run: bundle exec rake test:source_packaging
timeout-minutes: 1