Skip to content

Commit

Permalink
Merge pull request #14 from Setono/upgrade
Browse files Browse the repository at this point in the history
Upgrade library
  • Loading branch information
loevgaard authored Sep 21, 2022
2 parents b0e4028 + 0d0a3b2 commit 5434e38
Show file tree
Hide file tree
Showing 21 changed files with 286 additions and 178 deletions.
25 changes: 0 additions & 25 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,42 +1,17 @@
root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true


[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.neon]
indent_style = tab
indent_size = 4

[*.php]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4

[phpstan.neon]
indent_style = tab
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4
11 changes: 2 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ updates:
directory: "/"
package-ecosystem: "composer"
schedule:
interval: "daily"

- commit-message:
include: "scope"
prefix: "github-actions"
directory: "/"
package-ecosystem: "github-actions"
schedule:
interval: "daily"
interval: "weekly"
versioning-strategy: "increase-if-necessary"
226 changes: 186 additions & 40 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,192 @@
name: build
name: "build"
on:
push: ~
push:
branches:
- "master"
pull_request: ~
schedule:
- cron: 5 8 * * 2
workflow_dispatch: ~

jobs:
checks:
name: 'PHP ${{ matrix.php-versions }} with composer args: ${{ matrix.composer-args }}'
runs-on: ${{ matrix.operating-system }}
coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4']
composer-args: ['--prefer-lowest --prefer-stable', '']
php-version:
- "7.4"

dependencies:
- "highest"

steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
coverage: none
tools: composer-require-checker, composer-unused
- name: Install Composer dependencies
run: composer update --no-progress --no-suggest --prefer-dist --no-interaction ${{ matrix.composer-args }}
- name: Validate composer
run: composer validate --strict
- name: Check composer normalized
run: composer normalize --dry-run
- name: Check style
run: composer check-style
- name: Static analysis
run: composer analyse
- name: Run phpunit
run: composer phpunit
- name: Composer require checker
run: composer-require-checker
- name: Composer unused checker
run: composer-unused
- name: Upload coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
- name: "Checkout"
uses: "actions/checkout@v3"

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Validate composer"
run: "composer validate --strict"

- name: "Check composer normalized"
run: "composer normalize --dry-run"

- name: "Check style"
run: "composer check-style"

dependency-analysis:
name: "Dependency Analysis"

runs-on: "ubuntu-latest"

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

dependencies:
- "highest"

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

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
tools: "composer-require-checker, composer-unused"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run maglnet/composer-require-checker"
run: "composer-require-checker check"

- name: "Run composer-unused/composer-unused"
run: "composer-unused"

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

runs-on: "ubuntu-latest"

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

dependencies:
- "highest"

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

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Static analysis"
run: "composer analyse"

unit-tests:
name: "Unit tests"

runs-on: "ubuntu-latest"

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

dependencies:
- "highest"

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

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
coverage: "none"

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run phpunit"
run: "composer phpunit"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "8.1"

dependencies:
- "highest"

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

- name: "Setup PHP, with composer and extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Collect code coverage with pcov and phpunit/phpunit"
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"
16 changes: 0 additions & 16 deletions .scrutinizer.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Setono
Copyright (c) 2020-present Setono

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Google gtag tag for the tag bag library

[![Latest Version][ico-version]][link-packagist]
[![Latest Unstable Version][ico-unstable-version]][link-packagist]
[![Software License][ico-license]](LICENSE)
[![Build Status][ico-github-actions]][link-github-actions]
[![Coverage Status][ico-code-coverage]][link-code-coverage]
[![Quality Score][ico-code-quality]][link-code-quality]

This tag bag extension makes it easier for you to inject [Googles `gtag`](https://developers.google.com/gtagjs) tag into your pages.

Expand All @@ -15,13 +13,8 @@ $ composer require setono/tag-bag-gtag
```

[ico-version]: https://poser.pugx.org/setono/tag-bag-gtag/v/stable
[ico-unstable-version]: https://poser.pugx.org/setono/tag-bag-gtag/v/unstable
[ico-license]: https://poser.pugx.org/setono/tag-bag-gtag/license
[ico-github-actions]: https://github.com/Setono/tag-bag-gtag/workflows/build/badge.svg
[ico-code-coverage]: https://img.shields.io/scrutinizer/coverage/g/Setono/tag-bag-gtag.svg
[ico-code-quality]: https://img.shields.io/scrutinizer/g/Setono/tag-bag-gtag.svg

[link-packagist]: https://packagist.org/packages/setono/tag-bag-gtag
[link-github-actions]: https://github.com/Setono/tag-bag-gtag/actions
[link-code-coverage]: https://scrutinizer-ci.com/g/Setono/tag-bag-gtag/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/Setono/tag-bag-gtag
12 changes: 12 additions & 0 deletions composer-unused.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

use ComposerUnused\ComposerUnused\Configuration\Configuration;
use ComposerUnused\ComposerUnused\Configuration\NamedFilter;

return static function (Configuration $config): Configuration {
return $config
->addNamedFilter(NamedFilter::fromString('setono/tag-bag'))
;
};
Loading

0 comments on commit 5434e38

Please sign in to comment.