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/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 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); });