Skip to content

Commit 897d221

Browse files
authored
fix: replace Travis with GitHub (#16)
1 parent e0a5f40 commit 897d221

File tree

6 files changed

+129
-88
lines changed

6 files changed

+129
-88
lines changed

.github/workflows/test.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
branches:
13+
- 'master'
14+
15+
jobs:
16+
test_unit:
17+
name: Unit Tests
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
include:
22+
- php: '7.1'
23+
symfony: '3.4.*'
24+
- php: '7.4'
25+
symfony: '3.4.*'
26+
- php: '7.2'
27+
symfony: '4.4.*'
28+
- php: '7.4'
29+
symfony: '4.4.*'
30+
- php: '7.2'
31+
symfony: '5.1.*'
32+
- php: '7.4'
33+
symfony: '5.1.*'
34+
steps:
35+
- name: checkout
36+
uses: actions/checkout@v2
37+
- name: setup php
38+
uses: nanasess/[email protected]
39+
with:
40+
php-version: ${{ matrix.php }}
41+
- name: prepare test environment
42+
run: |
43+
Tests/Functional/Scripts/downloadComposer.sh
44+
composer config extra.symfony.require "${{ matrix.symfony }}"
45+
composer config extra.symfony.allow-contrib true
46+
# adds flex, suppress composer.lock
47+
composer require symfony/flex --no-update
48+
# create a lock file
49+
composer install
50+
# updates to SYMFONY_VERSION, but runs recipes
51+
composer update symfony/*
52+
# reset tracked files
53+
git reset --hard
54+
# clean up recipe generated files and folders
55+
git clean -df
56+
- name: execute unit tests
57+
run: composer run-script quality
58+
- name: upload coverage
59+
env:
60+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
62+
63+
test_functional:
64+
name: Functional Tests
65+
needs:
66+
- test_unit
67+
runs-on: ubuntu-latest
68+
strategy:
69+
matrix:
70+
symfony:
71+
- '3.4.*'
72+
- '4.4.*'
73+
- '5.1.*'
74+
steps:
75+
- name: checkout
76+
uses: actions/checkout@v2
77+
- name: setup php
78+
uses: nanasess/[email protected]
79+
with:
80+
php-version: '7.4'
81+
- name: prepare test environment
82+
run: |
83+
Tests/Functional/Scripts/downloadComposer.sh
84+
composer config extra.symfony.require "${{ matrix.symfony }}"
85+
composer config extra.symfony.allow-contrib true
86+
# adds flex, suppress composer.lock
87+
composer require symfony/flex --no-update
88+
# create a lock file
89+
composer install
90+
# updates to SYMFONY_VERSION, but runs recipes
91+
composer update symfony/*
92+
# reset tracked files
93+
git reset --hard
94+
# clean up recipe generated files and folders
95+
git clean -df
96+
- name: install symfony cli
97+
run: |
98+
wget https://get.symfony.com/cli/installer -O - | bash
99+
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
100+
- name: execute functional tests
101+
env:
102+
SYMFONY_VERSION: ${{ matrix.symfony }}
103+
run: composer run-script phpunit-functional
104+
- name: show running containers
105+
run: docker ps

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
composer.lock
22
.phpunit.result.cache
3+
/.php-version
34
/build/
45
/vendor/

.travis.yml

-86
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
3+
EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
4+
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
5+
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
6+
7+
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]
8+
then
9+
>&2 echo 'ERROR: Invalid installer checksum'
10+
rm composer-setup.php
11+
exit 1
12+
fi
13+
14+
php composer-setup.php --quiet
15+
RESULT=$?
16+
rm composer-setup.php
17+
exit $RESULT

Tests/Functional/Scripts/requireAdditionalVendors.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/bin/bash
2+
shopt -s extglob
23

34
cd build/testproject/
45
composer remove auxmoney/opentracing-bundle-jaeger
5-
composer config repositories.origin vcs https://github.com/${PR_ORIGIN}
6-
composer require auxmoney/opentracing-bundle-zipkin:dev-${BRANCH}
6+
composer require auxmoney/opentracing-bundle-zipkin
7+
rm -fr vendor/auxmoney/opentracing-bundle-zipkin/*
8+
cp -r ../../!(build|vendor) vendor/auxmoney/opentracing-bundle-zipkin
9+
composer dump-autoload
710
cd ../../
811

912
docker run -d -p 9411:9411 --name zipkin openzipkin/zipkin:2.19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.4

0 commit comments

Comments
 (0)