Skip to content

Commit

Permalink
Drop Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Jan 8, 2021
1 parent 6ff9ab5 commit d665dd6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 69 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ jobs:
calculate-code-coverage: 'yes'
phpunit-flags: '--testsuite coverage --exclude-group covers-nothing --coverage-clover build/logs/clover.xml'

- operating-system: 'ubuntu-20.04'
php-version: '7.4'
job-description: 'with deployment'
execute-deployment: 'yes'

- operating-system: 'ubuntu-20.04'
php-version: '7.4'
job-description: 'with migration rules'
Expand Down Expand Up @@ -99,8 +104,8 @@ jobs:
composer-
- name: Configure Symfony Flex
if: matrix.execute-flex-with-symfony-version
run: composer config extra.symfony.require ${{ matrix.execute-flex-with-symfony-version }}
if: "matrix.execute-flex-with-symfony-version"

- name: Install dependencies
uses: nick-invision/retry@v2
Expand All @@ -113,8 +118,8 @@ jobs:
composer info -D
- name: Execute migration rules
if: matrix.execute-migration-rules == 'yes'
run: php php-cs-fixer fix --rules @PHP73Migration,@PHP71Migration:risky,blank_line_after_opening_tag -q
if: "matrix.execute-migration-rules == 'yes'"

- name: Run tests
continue-on-error: ${{ matrix.php-version == '8.0' }}
Expand All @@ -136,3 +141,19 @@ jobs:
PHP_CS_FIXER_IGNORE_ENV: ${{ matrix.PHP_CS_FIXER_IGNORE_ENV }}
PHP_CS_FIXER_FUTURE_MODE: 1
run: php php-cs-fixer --diff --dry-run -v fix

- name: Execute deployment checks
if: matrix.execute-deployment == 'yes'
run: |
./dev-tools/build.sh
PHP_CS_FIXER_TEST_ALLOW_SKIPPING_SMOKE_TESTS=0 vendor/bin/phpunit tests/Smoke/
- name: Execute deployment post-hook
if: matrix.execute-deployment == 'yes' && startsWith(github.ref, 'refs/tags/v')
env:
TRAVIS_TOKEN: ${{ secrets.TRAVIS_TOKEN }}
run: |
# ensure that deployment is happening only if tag matches version of PHP CS Fixer
test $(php dev-tools/info-extractor.php | jq -r .version.vnumber) == "${GITHUB_REF#refs/tags/}"
# trigger website update
./dev-tools/trigger-website.sh ${TRAVIS_TOKEN} ${GITHUB_REF#refs/tags/}
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion dev-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ composer require --no-update symfony/polyfill-mbstring

# install package deps without dev-deps / remove already installed dev-deps
# box can ignore dev-deps, but dev-deps, when installed, may lower version of prod-deps
composer update --no-interaction --no-progress --no-dev --prefer-stable
composer update --no-interaction --no-progress --no-dev --prefer-stable --optimize-autoloader
composer info -D | sort

composer show -d dev-tools humbug/box -q || composer update -d dev-tools --no-interaction --no-progress
Expand Down
28 changes: 7 additions & 21 deletions tests/AutoReview/CiConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,21 +125,18 @@ private static function assertSupportedPhpVersionsAreCoveredByCiJobs(array $supp

private function getAllPhpVersionsUsedByCiForDeployments()
{
$jobs = array_filter($this->getTravisJobs(), function ($job) {
return 'Deployment' === $job['stage'];
$jobs = array_filter($this->getGitHubJobs(), function ($job) {
return isset($job['execute-deployment']) && 'yes' === $job['execute-deployment'];
});

return array_map(function ($job) {
return \is_string($job['php']) ? $job['php'] : sprintf('%.1f', $job['php']);
return \is_string($job['php-version']) ? $job['php-version'] : sprintf('%.1f', $job['php-version']);
}, $jobs);
}

private function getAllPhpVersionsUsedByCiForTests()
{
return array_merge(
$this->getPhpVersionsUsedByTravis(),
$this->getPhpVersionsUsedByGitHub()
);
return $this->getPhpVersionsUsedByGitHub();
}

private function convertPhpVerIdToNiceVer($verId)
Expand Down Expand Up @@ -188,11 +185,11 @@ private function getMinPhpVersionFromEntryFile()
return $this->convertPhpVerIdToNiceVer($phpVerId);
}

private function getTravisJobs()
private function getGitHubJobs()
{
$yaml = Yaml::parse(file_get_contents(__DIR__.'/../../.travis.yml'));
$yaml = Yaml::parse(file_get_contents(__DIR__.'/../../.github/workflows/ci.yml'));

return $yaml['jobs']['include'];
return $yaml['jobs']['tests']['strategy']['matrix']['include'];
}

private function getPhpVersionsUsedByGitHub()
Expand All @@ -207,15 +204,4 @@ private function getPhpVersionsUsedByGitHub()

return $phpVersions;
}

private function getPhpVersionsUsedByTravis()
{
$jobs = array_filter($this->getTravisJobs(), function ($job) {
return false !== strpos($job['stage'], 'Test');
});

return array_map(function ($job) {
return (string) $job['php'];
}, $jobs);
}
}

0 comments on commit d665dd6

Please sign in to comment.