Skip to content

Commit c0739bc

Browse files
Alexandre-TNyholm
andauthored
Update documentation (#36)
* Update documentation * Create documentation for Github Actions * Update documentation for Travis configuration * Remove Travis and make Github actions simpler * Update Readme.md Co-authored-by: Tobias Nyholm <[email protected]>
1 parent bab4acd commit c0739bc

File tree

1 file changed

+36
-62
lines changed

1 file changed

+36
-62
lines changed

Readme.md

Lines changed: 36 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -97,69 +97,43 @@ class BundleInitializationTest extends BaseBundleTestCase
9797

9898
Be aware that if you make all services public then you will not get any errors if your bundles access this services even if they are private by nature.
9999

100-
## Configure Travis
100+
## Configure Github Actions
101101

102-
You want Travis to run against each currently supported LTS version of Symfony (since there would be only one per major version), plus the current if it's not an LTS too. There is no need for testing against version in between because Symfony follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
102+
You want ["Github actions"](https://docs.github.com/en/actions) to run against each currently supported LTS version of Symfony (since there would be only one per major version), plus the current if it's not an LTS too. There is no need for testing against version in between because Symfony follows [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
103103

104+
Create a file in .github/workflows directory:
104105
```yaml
105-
language: php
106-
sudo: false
107-
cache:
108-
directories:
109-
- $HOME/.composer/cache/files
110-
- $HOME/symfony-bridge/.phpunit
111-
112-
env:
113-
global:
114-
- PHPUNIT_FLAGS=""
115-
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"
116-
117-
matrix:
118-
fast_finish: true
119-
include:
120-
# Minimum supported dependencies with the latest and oldest PHP version
121-
- php: 7.2
122-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
123-
- php: 5.5
124-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
125-
126-
# Test the latest stable release
127-
- php: 5.5
128-
- php: 5.6
129-
- php: 7.0
130-
- php: 7.1
131-
- php: 7.2
132-
env: COVERAGE=true PHPUNIT_FLAGS="-v --testsuite main --coverage-text --coverage-clover=build/coverage.xml"
133-
134-
- php: 7.1
135-
env: DEPENDENCIES="dunglas/symfony-lock:^2"
136-
- php: 7.1
137-
env: DEPENDENCIES="dunglas/symfony-lock:^3"
138-
- php: 7.1
139-
env: DEPENDENCIES="dunglas/symfony-lock:^4"
140-
141-
# Latest commit to master
142-
- php: 7.2
143-
env: STABILITY="dev"
144-
145-
allow_failures:
146-
# Dev-master is allowed to fail.
147-
- env: STABILITY="dev"
148-
149-
before_install:
150-
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
151-
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
152-
- composer require --no-update symfony/phpunit-bridge:^4.0 ${DEPENDENCIES}
153-
154-
install:
155-
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
156-
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
157-
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
158-
- ./vendor/bin/simple-phpunit install
159-
160-
script:
161-
- composer validate --strict --no-check-lock
162-
- ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS
163-
106+
#.github/workflows/php.yml
107+
name: My bundle test
108+
109+
on:
110+
push: ~
111+
pull_request: ~
112+
113+
jobs:
114+
build:
115+
runs-on: ${{ matrix.operating-system }}
116+
name: PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
117+
strategy:
118+
matrix:
119+
operating-system: [ ubuntu-latest, windows-latest ]
120+
php: [ '7.4', '8.0' ]
121+
symfony: ['4.4', '5.3']
122+
123+
steps:
124+
- uses: actions/checkout@master
125+
126+
- name: Setup PHP ${{ matrix.php }}
127+
uses: shivammathur/setup-php@v2
128+
with:
129+
php-version: ${{ matrix.php }}
130+
tools: flex
131+
132+
- name: Download dependencies
133+
env:
134+
SYMFONY_REQUIRE: ${{ matrix.symfony }}
135+
uses: ramsey/composer-install@v1
136+
137+
- name: Run test suite on PHP ${{ matrix.php }} and Symfony ${{ matrix.symfony }}
138+
run: ./vendor/bin/phpunit
164139
```
165-

0 commit comments

Comments
 (0)