Run 2.x tests #1249
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run 2.x tests | |
on: | |
schedule: | |
- cron: '0 8 * * *' # Run at 8AM UTC. | |
push: | |
branches: | |
- '2.x' | |
- '2.x-**' | |
pull_request: | |
branches: | |
- '2.x' | |
jobs: | |
build: | |
name: Run tests | |
runs-on: ubuntu-latest | |
env: | |
COMPOSE_FILE: docker-compose.testing.yml | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v2 | |
- name: Start containers | |
run: docker-compose up -d | |
- name: Include module dependencies | |
run: | | |
docker-compose exec -u www-data -T www composer config --merge --json extra.merge-plugin.include '["web/modules/custom/*/*.json"]' | |
docker-compose exec -u www-data -T www composer update | |
- name: Run PHP CodeSniffer | |
run: docker-compose exec -u www-data -T www phpcs /opt/drupal/web/modules/custom --exclude=DrupalPractice.InfoFiles.NamespacedDependency | |
- name: Run PHPUnit tests | |
run: docker-compose exec -u www-data -T www phpunit /opt/drupal/web/modules/custom | |
- name: Test installing farm_rothamsted modules | |
run: docker-compose exec -u www-data -T www bash -c "drush site-install --db-url=pgsql://farm:farm@db/farm farm farm.modules='base' && drush en farm_rothamsted farm_rothamsted_quick farm_rothamsted_experiment farm_rothamsted_experiment_research -y" | |
- name: Test installing farm_rothamsted_dev | |
run: docker-compose exec -u www-data -T www bash -c "drush en farm_rothamsted_dev -y" |