Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
...
Browse files Browse the repository at this point in the history
FooBarWidget committed Oct 7, 2024
1 parent 01ee11f commit a1141b1
Showing 1 changed file with 315 additions and 71 deletions.
386 changes: 315 additions & 71 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@ jobs:
run: ./dev/ci/setup-sccache
env:
ARCH_AND_OS: x86_64-unknown-linux-musl
SCCACHE_LOG: debug
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Setup library dependencies
@@ -98,7 +97,6 @@ jobs:
run: ./dev/ci/setup-sccache
env:
ARCH_AND_OS: aarch64-apple-darwin
SCCACHE_LOG: debug
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Setup misc
@@ -135,75 +133,321 @@ jobs:
run: ./dev/ci/teardown-sccache
if: always()

# integration:
# name: '${{ matrix.integration.name }} integration tests on ${{ matrix.os }}'
# strategy:
# fail-fast: false
# matrix:
# os:
# - macos-latest
# - ubuntu-latest
# integration:
# - name: 'Apache 2'
# label: 'apache2'
# - name: 'Nginx dynamic module'
# label: 'nginx-dynamic'
# - name: 'Nginx'
# label: 'nginx'
# - name: 'Standalone'
# label: 'standalone'
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
# bundler-cache: true
# - run: ./dev/ci/setup-host ${{ matrix.integration.label }}
# - run: ./dev/ci/run-tests-with-docker ${{ matrix.integration.label }}
# if: matrix.os == 'ubuntu-latest'
# - run: ./dev/ci/run-tests-natively ${{ matrix.integration.label }}
# if: matrix.os == 'macos-latest'
# - run: ls -R buildout
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.integration.label }}-${{ matrix.os }}
# path: 'buildout/testlogs/*'

# language:
# name: '${{ matrix.lang.name }} unit tests on ${{ matrix.os }}'
# strategy:
# fail-fast: false
# matrix:
# lang:
# - name: 'Node.js'
# label: 'nodejs'
# - name: 'Ruby'
# label: 'ruby'
# os:
# - macos-latest
# - ubuntu-latest
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: true
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
# bundler-cache: true
# - run: ./dev/ci/setup-host ${{ matrix.lang.label }}
# - run: ./dev/ci/run-tests-with-docker ${{ matrix.lang.label }}
# if: matrix.os == 'ubuntu-latest'
# - run: ./dev/ci/run-tests-natively ${{ matrix.lang.label }}
# if: matrix.os == 'macos-latest'
# - run: ls -R buildout
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.lang.label }}-${{ matrix.os }}
# path: 'buildout/testlogs/*'
apache2:
name: "Apache2 tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true

- uses: actions/setup-node@v4
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
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: Test module installation as normal user
run: ./bin/passenger-install-apache2-module --auto

- name: Test module installation as root
run: sudo -E -- ./bin/passenger-install-apache2-module --auto --no-compile

- name: Integration tests
run: bundle exec rake test:integration:apache2

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: apache-test-logs-${{ matrix.os }}
path: 'buildout/testlogs/*'

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

nginx:
name: "Nginx tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true

- uses: actions/setup-node@v4
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
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: Test installation
run: ./bin/passenger-install-nginx-module --auto --prefix=/tmp/nginx --auto-download

- name: Integration tests
run: bundle exec rake test:integration:nginx

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: nginx-test-logs-${{ matrix.os }}
path: 'buildout/testlogs/*'

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

nginx_dynamic:
name: "Nginx dynamic module tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
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
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Setup parameters
run: |
TEST_DYNAMIC_WITH_NGINX_VERSION=$(ruby -r "$PASSENGER_ROOT/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 test:nginx_dynamic:compile

- name: Download Nginx source
run: curl -sSLO "https://www.nginx.org/download/nginx-$TEST_DYNAMIC_WITH_NGINX_VERSION.tar.gz"

- name: Extract Nginx source
run: tar -xzf "nginx-$TEST_DYNAMIC_WITH_NGINX_VERSION.tar.gz"

- name: Configure Nginx source
run: ./configure --with-cc-opt='-Wno-error' --add-dynamic-module="$NGINX_ADDON_DIR"
working-directory: "nginx-${{ env.TEST_DYNAMIC_WITH_NGINX_VERSION }}"

- name: Compile Nginx with dynamic module
run: make -j4
working-directory: "nginx-${{ env.TEST_DYNAMIC_WITH_NGINX_VERSION }}"

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

standalone:
name: "Passenger Standalone tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
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
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Compile
run: bundle exec drake -j4 agent

- name: Integration test
run: bundle exec drake -j4 test:integration:standalone

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

ruby:
name: "Ruby tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
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
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Compile
run: bundle exec drake -j4 test:ruby

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

nodejs:
name: "Node.js tests on ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
config_file: test/config.json.github-ci-linux
sccache_arch_and_os: x86_64-unknown-linux-musl
- name: macOS
os: macos-latest
config_file: test/config.json.github-ci-macos
sccache_arch_and_os: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.DEFAULT_RUBY_VERSION }}
bundler-cache: true

- uses: actions/setup-node@v4
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
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}

- name: Compile
run: bundle exec drake -j4 test:node

- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()

homebrew_packaging:
name: Homebrew packaging tests

0 comments on commit a1141b1

Please sign in to comment.