From 19177a59b3d3236e0866a3d3128b49d25dd9cc7a Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:10:41 +0930 Subject: [PATCH 1/8] chore: use github actions instead of circleci --- .github/dependabot.yml | 8 ++++ .github/workflows/build.yml | 87 +++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 27 +++++++++++ 3 files changed, 122 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ecc7b39 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "master" + schedule: + interval: "daily" + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..96cda1c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,87 @@ +name: Test +on: [pull_request] + +jobs: + psalm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Psalm + uses: docker://vimeo/psalm-github-actions + with: + security_analysis: true + report_file: results.sarif + + - name: Upload Security Analysis results to GitHub + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: results.sarif + + # codecov: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + + # - name: Cache Composer dependencies + # uses: actions/cache@v2 + # with: + # path: /tmp/composer-cache + # key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + + # - uses: php-actions/composer@v5 + + # - uses: php-actions/phpunit@v2 + # env: + # XDEBUG_MODE: coverage + # with: + # php_extensions: xdebug + # args: --coverage-clover coverage.xml + + # - uses: codecov/codecov-action@v1 + # with: + # file: ./coverage.xml + # fail_ci_if_error: true + # verbose: true + + test: + runs-on: ubuntu-latest + strategy: + matrix: + php: + - 7.1 + - 7.2 + - 7.3 + - 7.4 + - 8.0 + include: + - php: 7.1 + phpunit: 7.5.20 + - php: 7.2 + phpunit: 8.5.13 + - php: 7.3 + phpunit: 9.5.0 + - php: 7.4 + phpunit: 9.5.0 + - php: 8.0 + phpunit: 9.5.0 + + steps: + - uses: actions/checkout@v2 + + - name: Cache Composer dependencies + uses: actions/cache@v2 + with: + path: /tmp/composer-cache + key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} + + - uses: php-actions/composer@v5 + with: + php_version: ${{ matrix.php }} + + - uses: php-actions/phpunit@v2 + with: + php_version: ${{ matrix.php }} + version: ${{ matrix.phpunit }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ddc702b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release +on: + workflow_dispatch: + inputs: + dryrun: + description: "DryRun" + required: false + default: 'true' +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v2 + + - name: git/unshallow + run: git fetch --prune --unshallow + + - uses: cycjimmy/semantic-release-action@v2 + with: + dry_run: ${{ github.event.inputs.dryrun }} + extra_plugins: | + @semantic-release/changelog + @semantic-release/git + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From 1784c31ecaaa3858e19489db5a29b3de92cb19d3 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:11:27 +0930 Subject: [PATCH 2/8] chore: remove circleci --- .circleci/config.yml | 87 -------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 25c68c3..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,87 +0,0 @@ -version: 2 - -jobs: - test-7.1: - docker: - - image: circleci/php:7.1-node-browsers - steps: - - checkout - - run: sudo composer self-update - - restore_cache: - keys: - - composer-v1-{{ checksum "composer.lock" }} - - composer-v1- - - run: composer install -n --prefer-dist - - save_cache: - key: composer-v1-{{ checksum "composer.lock" }} - paths: - - vendor - - run: ./vendor/bin/phpunit --coverage-text - - test-7.2: - docker: - - image: circleci/php:7.2-node-browsers - steps: - - checkout - - run: sudo composer self-update - - restore_cache: - keys: - - composer-v1-{{ checksum "composer.lock" }} - - composer-v1- - - run: composer install -n --prefer-dist - - save_cache: - key: composer-v1-{{ checksum "composer.lock" }} - paths: - - vendor - - run: - name: Setup Code Climate test-reporter - command: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - - run: - name: Run tests - command: | - sudo docker-php-ext-enable xdebug - ./cc-test-reporter before-build - vendor/bin/phpunit --coverage-clover clover.xml - ./cc-test-reporter after-build --coverage-input-type clover --exit-code $? - - release-dry-run: - docker: - - image: circleci/node:9 - steps: - - checkout - - run: yarn global add --prefer-offline --no-progress --non-interactive "semantic-release@15.5.0" "@semantic-release/exec@2.2.4" - - run: $(yarn global bin)/semantic-release --dry-run - - release: - docker: - - image: circleci/node:9 - steps: - - checkout - - run: yarn global add --prefer-offline --no-progress --non-interactive "semantic-release@15.5.0" "@semantic-release/exec@2.2.4" - - run: $(yarn global bin)/semantic-release - -workflows: - version: 2 - build-n-release: - jobs: - - test-7.1 - - test-7.2 - - release-dry-run: - context: org-global - - hold: - type: approval - requires: - - test-7.1 - - test-7.2 - filters: - branches: - only: master - - release: - context: org-global - requires: - - hold - filters: - branches: - only: master From 011e70c9db14a3dabe43a05d25532a82c95fcbc6 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:13:51 +0930 Subject: [PATCH 3/8] fix: disable 8.0 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96cda1c..4b2fed2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,7 @@ jobs: - 7.2 - 7.3 - 7.4 - - 8.0 + # - 8.0 include: - php: 7.1 phpunit: 7.5.20 @@ -65,8 +65,8 @@ jobs: phpunit: 9.5.0 - php: 7.4 phpunit: 9.5.0 - - php: 8.0 - phpunit: 9.5.0 + # - php: 8.0 + # phpunit: 9.5.0 steps: - uses: actions/checkout@v2 From 14efece1e4ed751ae1f14433a196310c08b7152c Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:16:53 +0930 Subject: [PATCH 4/8] chore: match with circleci --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b2fed2..ddb34f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,18 +53,18 @@ jobs: php: - 7.1 - 7.2 - - 7.3 - - 7.4 + # - 7.3 + # - 7.4 # - 8.0 include: - php: 7.1 phpunit: 7.5.20 - php: 7.2 phpunit: 8.5.13 - - php: 7.3 - phpunit: 9.5.0 - - php: 7.4 - phpunit: 9.5.0 + # - php: 7.3 + # phpunit: 9.5.0 + # - php: 7.4 + # phpunit: 9.5.0 # - php: 8.0 # phpunit: 9.5.0 From b8e7fd84ae66bb7cf5448af5946f3493fd48e94d Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:18:58 +0930 Subject: [PATCH 5/8] chore: remove travis --- .travis.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 66387ac..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: false - -language: php - -php: - - 7.1 - - 7.2 - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - phpunit --coverage-text - -after_script: - - php vendor/bin/codacycoverage clover build/logs/clover.xml - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml - - bash <(curl -s https://codecov.io/bash) -f build/logs/clover.xml From ffef4c2b5b51e30a2adab4e5479c2b259ac5f92f Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:19:49 +0930 Subject: [PATCH 6/8] chore: keep only clover xml report --- phpunit.xml.dist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 14cbb33..2b381e2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -21,10 +21,6 @@ - - From 701f8430e1b47015ffb3e2a2de410bdef6cb6fc4 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:22:12 +0930 Subject: [PATCH 7/8] chore: disable 7.2 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddb34f1..36a3556 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: matrix: php: - 7.1 - - 7.2 + # - 7.2 # - 7.3 # - 7.4 # - 8.0 From 869d5697f8006656119815d96632284d655556dd Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 22 Jun 2021 14:23:55 +0930 Subject: [PATCH 8/8] chore: disable 7.2 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36a3556..5fe9c86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,8 +59,8 @@ jobs: include: - php: 7.1 phpunit: 7.5.20 - - php: 7.2 - phpunit: 8.5.13 + # - php: 7.2 + # phpunit: 8.5.13 # - php: 7.3 # phpunit: 9.5.0 # - php: 7.4