Skip to content

Commit 3f29768

Browse files
committed
Migrate from travis to github actions.
1 parent 360dce4 commit 3f29768

File tree

2 files changed

+54
-44
lines changed

2 files changed

+54
-44
lines changed

.github/workflows/test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
push:
3+
branches: [ 7.x-1.x, 7.x-2.x ]
4+
pull_request:
5+
branches: [ 7.x-1.x, 7.x-2.x ]
6+
7+
jobs:
8+
phpunit:
9+
runs-on: ubuntu-18.04
10+
env:
11+
DB_DATABASE: drupal
12+
DB_USER: root
13+
DB_PASSWORD: root
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: "Setup PHP 7.3"
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: "7.3"
20+
- name: Start MySQL
21+
run: |
22+
sudo systemctl start mysql
23+
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
24+
- name: Set env
25+
run: |
26+
echo "REPO=`pwd`" >> $GITHUB_ENV
27+
echo "COMPOSER_HOME=${HOME}/.config/composer" >> $GITHUB_ENV
28+
echo "ROOT=${HOME}/drupal-root" >> $GITHUB_ENV
29+
- name: Get Composer Cache Directory
30+
id: composer-cache
31+
run: |
32+
echo "::set-output name=dir::$(composer config cache-files-dir)"
33+
- uses: actions/cache@v2
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-
37+
restore-keys: |
38+
${{ runner.os }}-composer-
39+
- name: Install composer packages
40+
run: |
41+
mkdir -p $COMPOSER_HOME
42+
cd $COMPOSER_HOME
43+
composer require drush/drush:8.1.* phpunit/phpunit:^8 torotil/upal:2.0.0-RC1 stripe/stripe-php:7.27.2
44+
- name: Bootstrap drupal
45+
run: |
46+
php -d sendmail_path=`which true` $COMPOSER_HOME/vendor/bin/drush.php --yes core-quick-drupal --core=drupal-7.69 --profile=testing --no-server --db-url=mysql://${{ env.DB_USER }}:${{ env.DB_PASSWORD }}@127.0.0.1:3306/${{ env.DB_DATABASE }} --root=$ROOT
47+
ln -s $REPO $ROOT/sites/all/modules/module_under_test
48+
cd $ROOT
49+
curl https://www.drupal.org/files/issues/1891356-drupal_static_reset-on-module-changes-30-D7.patch | patch -p1
50+
drush dl ctools form_builder-7.x-2.0-alpha2 jquery_update little_helpers psr0 select2 variable webform
51+
drush --yes pm-enable autocomplete_api form_builder_webform
52+
- name: Run phpunit tests
53+
run: UPAL_ROOT=$ROOT UPAL_WEB_URL=http://127.0.0.1 XDEBUG_MODE=coverage phpunit --bootstrap=$COMPOSER_HOME/vendor/torotil/upal/bootstrap.php --coverage-clover=coverage.xml .
54+
- uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)