Skip to content

Commit

Permalink
Migrate from TravisCI to GitHub Actions (PHPMailer#2218)
Browse files Browse the repository at this point in the history
* Remove TravisCI, add Github actions

* Fix missing steps

* Fix composer command

* Fix composer command 2nd :(

* Install postfix

* Postfix set up

* Fix missing sudos

* More sudos

* Fix permissions

* Sendmail path

* Debug

* Debug

* Debug

* Sendmail path

* Code coverage path

* Fix clover.xml path

* Install qmail

* Github Actions CI

* Add more PHP versions

* Add more PHP versions

* Use Ubuntu 18.04

Co-authored-by: Marcus Bointon <[email protected]>
  • Loading branch information
codedge and Synchro authored Dec 9, 2020
1 parent 4ddf42b commit e78f71a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 72 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "CI/CD"

on: [push]

jobs:

coding-standard:
runs-on: ubuntu-18.04
strategy:
matrix:
php: ['8.0']
dependency-version: [prefer-stable]
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: Install dependencies
run: composer install --no-interaction

- name: PHP CS
run: ./vendor/bin/phpcs -s

test:
needs: ['coding-standard']
runs-on: ubuntu-18.04
strategy:
matrix:
php: ['5.5', '5.6', '7.0.', '7.1', '7.2', '7.3', '7.4', '8.0']
dependency-version: [prefer-stable]
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-values: sendmail_path=/usr/sbin/sendmail -t -i

- name: Install PHP packages
run: composer install --no-interaction

- name: Install postfix
run: |
sudo apt-get install -y -qq postfix qmail
sudo service postfix stop
- name: Set up sendmail
run: |
smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
mkdir -p build/logs
sudo cp test/testbootstrap-dist.php test/testbootstrap.php
sudo chmod +x test/fakesendmail.sh
sudo mkdir -p /var/qmail/bin
sudo cp test/fakesendmail.sh /var/qmail/bin/sendmail
sudo cp test/fakesendmail.sh /usr/sbin/sendmail
- name: Run tests
run: ./vendor/bin/phpunit --configuration ./phpunit.xml.dist

- name: Downloading scrutinizer ocular.phar
run: wget https://scrutinizer-ci.com/ocular.phar

- name: Uploading code coverage to scrutinizer
run: php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ See [changelog](changelog.md).
### What's changed since moving from SourceForge?
- Official successor to the SourceForge and Google Code projects.
- Test suite.
- Continuous integration with Travis-CI.
- Continuous integration with Github Actions.
- Composer support.
- Public development.
- Additional languages and language strings.
Expand Down
File renamed without changes.

0 comments on commit e78f71a

Please sign in to comment.