-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use github workflow #500
Merged
Merged
use github workflow #500
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
env: | ||
VARNISH_VERSION: '6.6' | ||
VARNISH_MODULES_VERSION: '0.18.0' | ||
DEPENDENCIES: 'toflar/psr6-symfony-http-cache-store:^2.2.0|^3.0.0' | ||
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=0' | ||
SYMFONY_PHPUNIT_VERSION: '8' | ||
|
||
jobs: | ||
latest: | ||
name: PHP ${{ matrix.php }} Varnish 6 | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- php: '7.2' | ||
- php: '7.3' | ||
- php: '7.4' | ||
env: | ||
DEPENDENCIES: 'symfony/lts:^3 toflar/psr6-symfony-http-cache-store:^2.2.0\|^3.0.0' | ||
- php: '7.4' | ||
env: | ||
DEPENDENCIES: 'symfony/flex' | ||
SYMFONY_VERSION: '^4' | ||
- php: '8.0' | ||
- php: '8.1' | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Varnish and Nginx | ||
run: | | ||
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh | ||
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh | ||
|
||
- name: Install composer dependencies | ||
run: | | ||
composer require --no-update ${DEPENDENCIES} | ||
composer update --prefer-dist --no-interaction --no-progress | ||
vendor/bin/simple-phpunit install | ||
|
||
- name: Execute tests | ||
run: vendor/bin/simple-phpunit -v | ||
|
||
# spent hours trying to make this work | ||
# unfortunately, the installation always picks the varnish 5 from ubuntu instead of the specified one | ||
# installing with `apt-get install varnish=${VARNISH_VERSION}.*` reports that the version is not found | ||
# | ||
# varnish5: | ||
# name: PHP ${{ matrix.php }} Legacy Varnish 5 | ||
# runs-on: ubuntu-18.04 | ||
# env: | ||
# VARNISH_VERSION: '5.1' | ||
# VARNISH_MODULES_VERSION: '0.14.0' | ||
# | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# include: | ||
# - php: '7.4' | ||
# | ||
# steps: | ||
# - name: Setup PHP | ||
# uses: shivammathur/setup-php@v2 | ||
# with: | ||
# php-version: ${{ matrix.php }} | ||
# tools: composer:v2 | ||
# coverage: none | ||
# | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Setup Varnish and Nginx | ||
# run: | | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh | ||
# | ||
# - name: Install composer dependencies | ||
# run: | | ||
# composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress | ||
# vendor/bin/simple-phpunit install | ||
# | ||
# - name: Execute tests | ||
# run: vendor/bin/simple-phpunit -v | ||
# | ||
# varnish4: | ||
# name: PHP ${{ matrix.php }} Legacy Varnish 4 | ||
# runs-on: ubuntu-18.04 | ||
# env: | ||
# VARNISH_VERSION: '4.1' | ||
# VARNISH_MODULES_VERSION: '0.9.1' | ||
# | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# include: | ||
# - php: '7.4' | ||
# | ||
# steps: | ||
# - name: Setup PHP | ||
# uses: shivammathur/setup-php@v2 | ||
# with: | ||
# php-version: ${{ matrix.php }} | ||
# tools: composer:v2 | ||
# coverage: none | ||
# | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Setup Varnish and Nginx | ||
# run: | | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh | ||
# | ||
# - name: Install composer dependencies | ||
# run: | | ||
# composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress | ||
# vendor/bin/simple-phpunit install | ||
# | ||
# - name: Execute tests | ||
# run: vendor/bin/simple-phpunit -v | ||
# | ||
# lowest: | ||
# name: PHP ${{ matrix.php }} Lowest, Varnish 3 | ||
# runs-on: ubuntu-18.04 | ||
# env: | ||
# VARNISH_VERSION: '3.0' | ||
# VARNISH_MODULES_VERSION: '' | ||
# DEPENDENCIES: '' | ||
# | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# php: ['7.2'] | ||
# | ||
# steps: | ||
# - name: Setup PHP | ||
# uses: shivammathur/setup-php@v2 | ||
# with: | ||
# php-version: ${{ matrix.php }} | ||
# tools: composer:v2 | ||
# coverage: none | ||
# | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
# | ||
# - name: Setup Varnish and Nginx | ||
# run: | | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh | ||
# sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh | ||
# | ||
# - name: Install composer dependencies | ||
# run: | | ||
# composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress | ||
# vendor/bin/simple-phpunit install | ||
# | ||
# - name: Execute tests | ||
# run: vendor/bin/simple-phpunit -v | ||
|
||
coverage: | ||
name: Code Coverage | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
tools: composer:v2 | ||
coverage: xdebug | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Varnish and Nginx | ||
run: | | ||
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh | ||
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update | ||
composer update --prefer-dist --no-interaction --no-progress | ||
vendor/bin/simple-phpunit install | ||
|
||
- name: Execute tests | ||
run: vendor/bin/simple-phpunit -v --coverage-text | ||
|
||
- name: Upload coverage | ||
run: | | ||
wget https://scrutinizer-ci.com/ocular.phar | ||
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
# Install NGINX | ||
sudo apt-get remove nginx | ||
sudo rm /usr/sbin/nginx | ||
sh "${GITHUB_WORKSPACE}/tests/install-nginx.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
echo "### Installing Legacy Varnish $VARNISH_VERSION ###" | ||
VARNISH_VERSION=$VARNISH_VERSION bash -c 'curl -s https://packagecloud.io/install/repositories/varnishcache/varnish${VARNISH_VERSION//./}/script.deb.sh' | sudo bash | ||
# this is broken: we don't find the version. when not specifying the version, we end up with varnish 5 from the regular ubuntu distribution | ||
VARNISH_VERSION=$VARNISH_VERSION bash -c 'sudo apt-get install varnish=${VARNISH_VERSION}.*' | ||
if [ "$VARNISH_MODULES_VERSION" != "" ]; then sh "${GITHUB_WORKSPACE}/tests/install-varnish-modules-legacy.sh"; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
echo "### Installing Varnish $VARNISH_VERSION ###" | ||
VARNISH_VERSION=$VARNISH_VERSION bash -c 'curl -s https://packagecloud.io/install/repositories/varnishcache/varnish${VARNISH_VERSION//./}/script.deb.sh' | sudo bash | ||
sudo apt-get install -t focal varnish | ||
if [ "$VARNISH_MODULES_VERSION" != "" ]; then sh "${GITHUB_WORKSPACE}/tests/install-varnish-modules.sh"; fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i gave up on this for now, to move forward => #510