From f9f33c2c5113dfd5f5a4e2f662afce22fc3f10fd Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 2 May 2023 04:58:12 +0200 Subject: [PATCH 1/3] Remove phpstan error line --- app/Models/Discussion.php | 1 - app/View/Composers/TopContributorsComposer.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Models/Discussion.php b/app/Models/Discussion.php index 26a7688a..ebd95baa 100644 --- a/app/Models/Discussion.php +++ b/app/Models/Discussion.php @@ -117,7 +117,6 @@ public function getCountAllRepliesWithChildAttribute(): int foreach ($this->replies()->withCount('allChildReplies')->get() as $reply) { /** @var Reply $reply */ - // @phpstan-ignore-next-line $count += $reply->all_child_replies_count; } diff --git a/app/View/Composers/TopContributorsComposer.php b/app/View/Composers/TopContributorsComposer.php index 405d3e2e..24e0f475 100644 --- a/app/View/Composers/TopContributorsComposer.php +++ b/app/View/Composers/TopContributorsComposer.php @@ -15,7 +15,7 @@ public function compose(View $view): void $topContributors = Cache::remember('contributors', now()->addWeek(), function () { return User::topContributors() ->get() - ->filter(fn (User $contributor) => $contributor->loadCount('discussions')->discussions_count >= 1) // @phpstan-ignore-line + ->filter(fn (User $contributor) => $contributor->loadCount('discussions')->discussions_count >= 1) ->take(5); }); From d2b8e1563e17d4bf5cf62583ddea5123dfcd81dd Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 2 May 2023 04:58:24 +0200 Subject: [PATCH 2/3] :construction_worker: Add new github actions --- .github/workflows/npm-build.yml | 35 +++++++++++++++++++++++++++++++++ .github/workflows/pint.yml | 24 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/npm-build.yml create mode 100644 .github/workflows/pint.yml diff --git a/.github/workflows/npm-build.yml b/.github/workflows/npm-build.yml new file mode 100644 index 00000000..7ad5e8d9 --- /dev/null +++ b/.github/workflows/npm-build.yml @@ -0,0 +1,35 @@ +name: npm-build + +on: + pull_request: + branches: + - main + types: [closed] + +jobs: + npm-build: + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: 2.x + + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: "16.x" + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Build assets + run: yarn run production + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: > + chore: build assets diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml new file mode 100644 index 00000000..7d25d47a --- /dev/null +++ b/.github/workflows/pint.yml @@ -0,0 +1,24 @@ +name: Laravel Pint Formatting + +on: push + +jobs: + pint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + + - name: Install Composer + run: composer install + + - name: Run Laravel Pint + run: composer pint + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Apply code formatting From e5f159136b68cde0b19333e7b6aced18e87d0876 Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Tue, 2 May 2023 05:00:44 +0200 Subject: [PATCH 3/3] Remove pint github actions --- .github/workflows/pint.yml | 24 ------------------------ .github/workflows/tests.yml | 3 +++ 2 files changed, 3 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/pint.yml diff --git a/.github/workflows/pint.yml b/.github/workflows/pint.yml deleted file mode 100644 index 7d25d47a..00000000 --- a/.github/workflows/pint.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Laravel Pint Formatting - -on: push - -jobs: - pint: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - - name: Install Composer - run: composer install - - - name: Run Laravel Pint - run: composer pint - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Apply code formatting diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f71946f7..26b2e6d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,5 +21,8 @@ jobs: - name: Install Composer dependencies run: composer install --prefer-dist --no-interaction + - name: Run Laravel Pint + run: composer pint + - name: Execute tests run: composer pest