Skip to content

CI

CI #90

Workflow file for this run

name: CI
on:
push:
pull_request:
schedule:
# Run every on Friday to ensure everything works as expected.
- cron: '0 6 * * 5'
jobs:
CI:
runs-on: ubuntu-latest
container:
image: zammad/zammad-ci:latest
services:
postgresql:
image: postgres:14
env:
POSTGRES_USER: zammad
POSTGRES_PASSWORD: zammad
redis:
# Use Redis 5 which is shipped in Debian 10.
image: redis:5
env:
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://localhost:3000"
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "[email protected]"
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
strategy:
fail-fast: false
matrix:
php: ['7.4', '7.3', '7.2', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- name: Install PHP
uses: shivammathur/setup-php@v2
env:
fail-fast: true
with:
php-version: ${{ matrix.php }}
- name: Report PHP version
run: php -v
- name: Install dependencies
shell: bash
run: |
composer install
- name: Set up Zammad
shell: bash
run: |
git clone --depth 1 https://github.com/zammad/zammad.git
cd zammad
source /etc/profile.d/rvm.sh # ensure RVM is loaded
bundle config set --local frozen 'true'
bundle config set --local path 'vendor'
bundle install -j $(nproc)
bundle exec ruby .gitlab/configure_environment.rb
source .gitlab/environment.env
RAILS_ENV=test bundle exec rake db:create
RAILS_ENV=test bundle exec rake zammad:ci:test:start zammad:setup:auto_wizard
- name: Run PHP API integration tests
shell: bash
run: |
vendor/bin/phpunit