Run module tests #250
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 module tests | |
on: | |
pull_request: | |
schedule: | |
- cron: '0 6 * * *' | |
env: | |
DRUPAL_TESTING_TEST_CODING_STYLES: true | |
DRUPAL_TESTING_PROJECT_BASEDIR: ${{ github.workspace }}/tests/module | |
DRUPAL_TESTING_DATABASE_USER: root | |
DRUPAL_TESTING_DATABASE_PASSWORD: root | |
DRUPAL_TESTING_DATABASE_ENGINE: mysql | |
DRUPAL_TESTING_SELENIUM_CHROME_VERSION: '105.0' | |
jobs: | |
test-projects: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
RUN: [1, 2] | |
include: | |
- RUN: 1 | |
DRUPAL_TESTING_DRUPAL_VERSION: '~10.0' | |
PHP_VERSION: '8.1' | |
- RUN: 2 | |
DRUPAL_TESTING_DRUPAL_VERSION: '~10.0' | |
PHP_VERSION: '8.2' | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: ${{ matrix.PHP_VERSION }} | |
extensions: gd, pdo_mysql | |
- name: Start MySql service | |
run: | | |
sudo /etc/init.d/mysql start | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache | |
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer-cache- | |
- name: Setup environment variables | |
run: | | |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Run tests | |
run: | | |
composer install | |
test-drupal-project --verbose | |
env: | |
DRUPAL_TESTING_COMPOSER_PROJECT: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT }} | |
DRUPAL_TESTING_DRUPAL_VERSION: ${{ matrix.DRUPAL_TESTING_DRUPAL_VERSION }} | |
DRUPAL_TESTING_MIN_BUILD: ${{ matrix.DRUPAL_TESTING_MIN_BUILD }} | |
DRUPAL_TESTING_COMPOSER_PROJECT_VERSION: ${{ matrix.DRUPAL_TESTING_COMPOSER_PROJECT_VERSION }} | |
test-split-upload: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: '8.1' | |
extensions: gd, pdo_mysql | |
- name: Start MySql service | |
run: | | |
sudo /etc/init.d/mysql start | |
- name: Cache composer dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.composer/cache | |
key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer-cache- | |
- name: Cache NPM dependencies | |
id: npm-cache | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-npm-cache | |
restore-keys: ${{ runner.os }}-npm-cache | |
- name: Setup environment variables | |
run: | | |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Install project | |
run: | | |
composer install | |
test-drupal-project install --verbose | |
- name: Zip build | |
run: cd /tmp; tar cfz build.tgz test; mv build.tgz ${GITHUB_WORKSPACE} | |
- name: Upload build | |
uses: actions/upload-artifact@v1 | |
with: | |
name: build | |
path: build.tgz | |
test-split-download: | |
needs: test-split-upload | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
php-version: '8.1' | |
extensions: gd, pdo_mysql | |
- name: Start MySql service | |
run: | | |
sudo /etc/init.d/mysql start | |
- name: Setup environment variables | |
run: | | |
echo "$GITHUB_WORKSPACE/vendor/bin" >> $GITHUB_PATH | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Download build | |
uses: actions/download-artifact@v1 | |
with: | |
name: build | |
- name: Unzip build artifact | |
run: tar xCfz /tmp build/build.tgz test; rm -rf build | |
- name: Run the tests | |
run: test-drupal-project run_tests --verbose |