|
| 1 | +name: CI |
| 2 | +on: [push, pull_request] |
| 3 | +jobs: |
| 4 | + CI: |
| 5 | + runs-on: ubuntu-20.04 |
| 6 | + container: |
| 7 | + image: registry.zammad.com/docker/zammad-ci:stable |
| 8 | + credentials: |
| 9 | + username: ${{ secrets.ZAMMAD_DOCKER_REGISTRY_USERNAME }} |
| 10 | + password: ${{ secrets.ZAMMAD_DOCKER_REGISTRY_PASSWORD }} |
| 11 | + services: |
| 12 | + postgresql: |
| 13 | + image: registry.zammad.com/docker/zammad-postgresql:stable |
| 14 | + credentials: |
| 15 | + username: ${{ secrets.ZAMMAD_DOCKER_REGISTRY_USERNAME }} |
| 16 | + password: ${{ secrets.ZAMMAD_DOCKER_REGISTRY_PASSWORD }} |
| 17 | + env: |
| 18 | + ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://localhost:3000" |
| 19 | + ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "admin@example.com" |
| 20 | + ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test" |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Set up Zammad |
| 24 | + shell: bash |
| 25 | + run: | |
| 26 | + git clone https://github.com/zammad/zammad.git |
| 27 | + cd zammad |
| 28 | + source /etc/profile.d/rvm.sh # ensure RVM is loaded |
| 29 | + bundle config set --local frozen 'true' |
| 30 | + bundle config set --local path 'vendor' |
| 31 | + bundle install -j $(nproc) |
| 32 | + bundle exec ruby .gitlab/configure_environment.rb |
| 33 | + source .gitlab/environment.env |
| 34 | + RAILS_ENV=test bundle exec rake db:create |
| 35 | + cp contrib/auto_wizard_test.json auto_wizard.json |
| 36 | + bundle exec rake zammad:ci:test:start |
| 37 | + - name: Run PHP API integration tests |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + source /etc/profile.d/rvm.sh # ensure RVM is loaded |
| 41 | + bundle update --bundler |
| 42 | + bundle config set --local frozen 'true' |
| 43 | + bundle install -j $(nproc) |
| 44 | + bundle exec rspec |
0 commit comments