diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 7baa3a6..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,138 +0,0 @@ -version: 2.1 - -commands: - checkout-alpine: - description: Install alpine requirements for checkout - steps: - - run: - name: "Install alpine requirements for checkout" - command: apk add git openssh-client curl make - - checkout - - composer-install: - description: "Install dependencies" - steps: - - run: - name: "Execute: composer install" - command: | - if [ ! -f vendor/autoload.php ];then - curl https://getcomposer.org/composer-2.phar --location --silent --output /usr/bin/composer; - chmod +x /usr/bin/composer; - composer install --no-interaction --no-progress; - fi - - restore-composer-cache: - description: "Restore vendor folder from CircleCI cache" - steps: - - restore_cache: - key: composer-{{ checksum "composer.json" }} - - store-composer-cache: - description: "Store vendor folder in CircleCI cache" - steps: - - checkout-alpine - - restore-composer-cache - - composer-install - - save_cache: - key: composer-{{ checksum "composer.json" }} - paths: - - ./vendor - - persist_to_workspace: - root: . - paths: - - vendor - - phpcs: - description: "Execute PHPCS" - steps: - - run: - name: "Execute: make phpcs" - command: make phpcs - -executors: - php7_2: - docker: - - image: php:7.2-cli-alpine - working_directory: ~/repository - - php7_3: - docker: - - image: php:7.3-cli-alpine - working_directory: ~/repository - - php7_4: - docker: - - image: php:7.4-cli-alpine - working_directory: ~/repository - - php8_0: - docker: - - image: php:8.0-cli-alpine - working_directory: ~/repository - - php8_1: - docker: - - image: php:8.1-cli-alpine - working_directory: ~/repository - -jobs: - composer: - executor: php7_2 - steps: - - store-composer-cache - - phpcs_7_2: - executor: php7_2 - steps: - - checkout-alpine - - restore-composer-cache - - phpcs - - phpcs_7_3: - executor: php7_3 - steps: - - checkout-alpine - - restore-composer-cache - - phpcs - - phpcs_7_4: - executor: php7_4 - steps: - - checkout-alpine - - restore-composer-cache - - phpcs - - phpcs_8_0: - executor: php8_0 - steps: - - checkout-alpine - - restore-composer-cache - - phpcs - - phpcs_8_1: - executor: php8_1 - steps: - - checkout-alpine - - restore-composer-cache - - phpcs - -workflows: - version: 2.1 - Code quality: - jobs: - - composer - - phpcs_7_2: - requires: - - composer - - phpcs_7_3: - requires: - - composer - - phpcs_7_4: - requires: - - composer - - phpcs_8_0: - requires: - - composer - - phpcs_8_1: - requires: - - composer diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 0000000..6b8fca3 --- /dev/null +++ b/.github/workflows/code-quality.yaml @@ -0,0 +1,63 @@ +name: Code quality + +on: + push: + branches: + - '**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + composer: + runs-on: ubuntu-latest + + strategy: + matrix: + version: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ] + + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + key: composer-${{ hashFiles('composer.json') }}-${{ hashFiles('composer.lock') }}-${{ matrix.version }} + restore-keys: composer- + path: vendor + + - name: Install composer dependencies + uses: php-actions/composer@v6 + with: + interaction: no + dev: yes + php_version: ${{ matrix.version }} + version: 2 + args: --optimize-autoloader --no-scripts --ignore-platform-reqs + + lint: + runs-on: ubuntu-latest + + needs: composer + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Cache composer dependencies + uses: actions/cache@v3 + with: + key: composer-${{ hashFiles('composer.json') }}-${{ hashFiles('composer.lock') }}-${{ matrix.version }} + restore-keys: composer- + path: vendor + + - name: Install PHP with extension + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.version }} + + - name: PHP Code Sniffer + run: make phpcs