Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shared pipelines #452

Merged
merged 2 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
# These settings are synced to GitHub by https://probot.github.io/apps/settings/

_extends: .github

repository:
name: NucleosUserAdminBundle
description: 馃懁 Adminstration of users and groups in symfony
homepage: https://docs.nucleos.rocks/projects/user-admin-bundle/
topics: hacktoberfest, symfony, symfony-bundle, bundle, user, management, admin, sonata

branches:
- name: main
protection:
enforce_admins: false
required_status_checks:
contexts:
- "Coding Standards (8)"
- "Static Code Analysis (8.1)"
- "Test (PHP 8, symfony 5.4, lowest)"
- "Test (PHP 8, symfony 5.4, highest)"
- "Test (PHP 8.1, symfony 5.4, lowest)"
- "Test (PHP 8.1, symfony 5.4, highest)"
- "Code Coverage (8.1)"
- "Mutation Tests (8.1)"
strict: true

required_pull_request_reviews: null
restrictions: null
13 changes: 4 additions & 9 deletions .github/workflows/automatic-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ on:
- cron: '0 */2 * * *'

jobs:
merge:
name: "Merge Pull Requests"
runs-on: ubuntu-latest

steps:
- name: "Merge"
uses: "nucleos/auto-merge-action@1.2.0"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
run:
uses: "nucleos/actions/.github/workflows/automatic-merge.yml@main"
secrets:
GITHUB_ADMIN_TOKEN: "${{ secrets.ORGANIZATION_ADMIN_TOKEN }}"
64 changes: 8 additions & 56 deletions .github/workflows/automatic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,12 @@ on:
- "closed"

jobs:
release:
name: "GIT tag, release & create merge-up PR"
runs-on: ubuntu-latest
run:
uses: "nucleos/actions/.github/workflows/automatic-release.yml@main"
secrets:
GIT_AUTHOR_NAME: "${{ secrets.GIT_AUTHOR_NAME }}"
GIT_AUTHOR_EMAIL: "${{ secrets.GIT_AUTHOR_EMAIL }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_ADMIN_TOKEN: "${{ secrets.ORGANIZATION_ADMIN_TOKEN }}"
SIGNING_SECRET_KEY: "${{ secrets.SIGNING_SECRET_KEY }}"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create and/or Switch to new Release Branch"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Bump Changelog Version On Originating Release Branch"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:bump-changelog"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
229 changes: 8 additions & 221 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,224 +9,11 @@ on:
- 'refs/pull/*'

jobs:
coding-standards:
name: "Coding Standards"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 8.0

steps:
- name: "Checkout"
uses: actions/checkout@v2.4.0

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.16.0
with:
coverage: none
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v2.1.7
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress

- name: "Run composer lint"
run: make lint-composer

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: mkdir -p .build/php-cs-fixer

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: actions/cache@v2.1.7
with:
path: .build/php-cs-fixer
key: php${{ matrix.php-version }}-php-cs-fixer-
restore-keys: |
php${{ matrix.php-version }}-php-cs-fixer-

- name: "Run friendsofphp/php-cs-fixer"
env:
PHP_CS_FIXER_IGNORE_ENV: 1
run: make cs

static-code-analysis:
name: "Static Code Analysis"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 8.1

steps:
- name: "Checkout"
uses: actions/checkout@v2.4.0

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.16.0
with:
coverage: none
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v2.1.7
with:
path: ~/.composer/cache
key: ${{ matrix.php-version }}-composer-
restore-keys: |
${{ matrix.php-version }}-composer-

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress

- name: "Run phpstan/phpstan"
run: make phpstan

- name: "Run psalm"
run: make psalm

- name: "Run phpmd"
run: make phpmd

tests:
name: "Test (PHP ${{ matrix.php-version }}, symfony ${{ matrix.symfony }}, ${{ matrix.dependencies }})"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 8.0
- 8.1

dependencies:
- lowest
- highest

symfony:
- 5.4

steps:
- name: "Checkout"
uses: actions/checkout@v2.4.0

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.16.0
with:
coverage: none
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}

- name: 'Install Symfony Flex'
run: |
composer global require --prefer-dist --no-progress --ansi symfony/flex

- name: "Cache dependencies installed with composer"
uses: actions/cache@v2.1.7
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: "Lock symfony version"
run: composer config extra.symfony.require "${{ matrix.symfony }}.*"

- name: "Install lowest dependencies with composer"
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --prefer-lowest

- name: "Install highest dependencies with composer"
if: matrix.dependencies == 'highest'
run: composer update --no-interaction --no-progress

- name: "Run tests with phpunit/phpunit"
run: make test

code-coverage:
name: "Code Coverage"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 8.1

steps:
- name: "Checkout"
uses: actions/checkout@v2.4.0

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.16.0
with:
coverage: pcov
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v2.1.7
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: make coverage

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)

mutation-tests:
name: "Mutation Tests"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 8.0

steps:
- name: "Checkout"
uses: actions/checkout@v2.4.0

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.16.0
with:
coverage: pcov
extensions: "mbstring, json, mongo"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v2.1.7
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-
restore-keys: |
php${{ matrix.php-version }}-composer-

- name: "Install locked dependencies with composer"
run: composer install --no-interaction --no-progress

- name: "Run mutation tests with pcov and infection/infection"
run: make infection
run:
uses: "nucleos/actions/.github/workflows/continuous-integration.yml@main"
with:
PHP_EXTENSIONS: "mbstring, json, mongodb"
SYMFONY_VERSIONS: "5.4"
SYMFONY_KERNEL: "Nucleos\\UserAdminBundle\\Tests\\App\\AppKernel"
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
47 changes: 2 additions & 45 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,6 @@ on:
- 'refs/pull/*'

jobs:
build:
name: 'Build RST'
run:
uses: "nucleos/actions/.github/workflows/documentation.yml@main"

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2.3.4

- name: "Set up Python 3.7"
uses: actions/setup-python@v2.3.1
with:
python-version: '3.7' # Semantic version range syntax or exact version of a Python version

- name: "Display Python version"
run: python -c "import sys; print(sys.version)"

- name: "Cache pip"
uses: actions/cache@v2.1.7
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: "Install custom requirements via pip"
run: pip install -r docs/requirements.txt

- name: "Build documentation"
run: sphinx-build -W -b html -d _build/doctrees docs _build/html

doctor-rst:
name: 'DOCtor-RST'

runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2.3.4

- name: "Run DOCtor-RST"
uses: docker://oskarstark/doctor-rst
with:
args: --short
env:
DOCS_DIR: 'docs/'
Loading