-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1680ad4
commit f8e5224
Showing
4 changed files
with
168 additions
and
131 deletions.
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,167 @@ | ||
name: Continuous Integration | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
- 'master' | ||
- 'refs/heads/v[0-9]+.[0-9]+.[0-9]+' | ||
pull_request: | ||
jobs: | ||
supported-versions-matrix: | ||
name: Supported Versions Matrix | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint-yaml | ||
- lint-json | ||
outputs: | ||
version: ${{ steps.supported-versions-matrix.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- id: supported-versions-matrix | ||
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 | ||
composer-install: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} | ||
composer: [lowest, current] | ||
needs: | ||
- lint-yaml | ||
- lint-json | ||
- supported-versions-matrix | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache composer packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ./vendor/ | ||
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
- name: Install Dependencies | ||
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'lowest' | ||
- name: Install Dependencies | ||
run: composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'current' | ||
- name: Install Dependencies | ||
run: composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'highest' | ||
qa: | ||
name: Run ${{ matrix.check }} on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (Linux) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} | ||
composer: [lowest, current] | ||
check: [unit] | ||
needs: | ||
- lint-yaml | ||
- lint-json | ||
- composer-install | ||
- supported-versions-matrix | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache composer packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ./vendor/ | ||
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'lowest' | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'current' | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'highest' | ||
- name: Fetch Tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true | ||
if: matrix.check == 'backward-compatibility-check' | ||
- run: ./vendor/bin/phpunit | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} | ||
unittests-directly-on-os: | ||
name: Run unit tests on PHP ${{ matrix.php }} with ${{ matrix.composer }} dependency preference (${{ matrix.os }}) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} | ||
composer: [lowest, current] | ||
needs: | ||
- lint-yaml | ||
- lint-json | ||
- composer-install | ||
- supported-versions-matrix | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup PHP, extensions and composer with shivammathur/setup-php | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
coverage: xdebug, pcov | ||
- name: Cache composer packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ./vendor/ | ||
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'lowest' | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'current' | ||
- name: Install Dependencies | ||
run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o --ignore-platform-reqs | ||
if: matrix.composer == 'highest' | ||
- name: Fetch Tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true | ||
if: matrix.check == 'backward-compatibility-check' | ||
- run: | | ||
./vendor/bin/phpunit | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} | ||
lint-yaml: | ||
name: Lint YAML | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: yaml-lint | ||
uses: ibiqlik/action-yamllint@v3 | ||
with: | ||
config_data: | | ||
extends: default | ||
ignore: | | ||
/.git/ | ||
rules: | ||
line-length: disable | ||
document-start: disable | ||
truthy: disable | ||
lint-json: | ||
name: Lint JSON | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: json-syntax-check | ||
uses: limitusus/json-syntax-check@v1 | ||
with: | ||
pattern: "\\.json$" | ||
check-mark: | ||
name: ✔️ | ||
needs: | ||
- lint-yaml | ||
- lint-json | ||
- qa | ||
- unittests-directly-on-os | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "✔️" |
This file was deleted.
Oops, something went wrong.
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