2020-03-04 20:23:02 +00:00
|
|
|
name: ci
|
|
|
|
|
2020-03-05 18:43:50 +00:00
|
|
|
on:
|
|
|
|
pull_request
|
2020-03-04 20:23:02 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
ci:
|
|
|
|
runs-on: ubuntu-latest
|
2020-03-05 18:43:50 +00:00
|
|
|
services:
|
|
|
|
mysql:
|
|
|
|
image: mysql:5
|
|
|
|
env:
|
|
|
|
MYSQL_ROOT_PASSWORD: password
|
|
|
|
ports:
|
|
|
|
- 13306:3306
|
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
postgres:
|
|
|
|
image: postgres:11
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
2020-03-04 20:23:02 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
dbs:
|
|
|
|
- mysql
|
|
|
|
- postgresql
|
2020-03-05 18:43:50 +00:00
|
|
|
env:
|
|
|
|
RAILS_ENV: test
|
2020-03-04 20:23:02 +00:00
|
|
|
ZAMMAD_DBS: ${{ matrix.dbs }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2020-03-05 18:43:50 +00:00
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
2021-07-15 12:15:29 +00:00
|
|
|
ruby-version: 2.7.4
|
2020-03-05 18:43:50 +00:00
|
|
|
- name: Increase MySQL max_allowed_packet to 1GB (workaround for unknown/missing service option)
|
|
|
|
run: |
|
|
|
|
sudo apt-get install -y mysql-client
|
|
|
|
mysql --host 127.0.0.1 --port 13306 -uroot -ppassword -e "SET GLOBAL max_allowed_packet=1073741824;"
|
|
|
|
- name: CI
|
2020-03-04 20:23:02 +00:00
|
|
|
run: .github/ci.sh
|