Skip to content

Commit

Permalink
fix: replace Travis with GitHub (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
cawolf authored Dec 27, 2020
1 parent 74f0a10 commit d6935e1
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 89 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: test

on:
push:
branches:
- '*'
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- 'master'

jobs:
test_unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.1'
symfony: '3.4.*'
- php: '7.4'
symfony: '3.4.*'
- php: '7.2'
symfony: '4.4.*'
- php: '7.4'
symfony: '4.4.*'
- php: '7.2'
symfony: '5.1.*'
- php: '7.4'
symfony: '5.1.*'
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup php
uses: nanasess/setup-php@v3.0.6
with:
php-version: ${{ matrix.php }}
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: execute unit tests
run: composer run-script quality
- name: upload coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v

test_functional:
name: Functional Tests
needs:
- test_unit
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.1.*'
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup php
uses: nanasess/setup-php@v3.0.6
with:
php-version: '7.4'
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: install symfony cli
run: |
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
- name: execute functional tests
env:
SYMFONY_VERSION: ${{ matrix.symfony }}
run: composer run-script phpunit-functional
- name: show running containers
run: docker ps
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
composer.lock
.phpunit.result.cache
/.php-version
/build/
/vendor/
86 changes: 0 additions & 86 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions Tests/Functional/Scripts/downloadComposer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"

if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
fi

php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
8 changes: 5 additions & 3 deletions Tests/Functional/Scripts/requireAdditionalVendors.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
shopt -s extglob

cd build/testproject/
composer config repositories.origin vcs https://github.com/${PR_ORIGIN}
composer config use-github-api false
composer require auxmoney/opentracing-bundle-guzzle:dev-${BRANCH}
composer require auxmoney/opentracing-bundle-guzzle
rm -fr vendor/auxmoney/opentracing-bundle-guzzle/*
cp -r ../../!(build|vendor) vendor/auxmoney/opentracing-bundle-guzzle
composer dump-autoload
cd ../../
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4
1 change: 1 addition & 0 deletions Tests/Functional/TestProjectFiles/noHandler/.php-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4

0 comments on commit d6935e1

Please sign in to comment.