Skip to content

Commit ee065a5

Browse files
authored
Add new GitHub actions (#100)
* Remove phpstan error line * 👷 Add new github actions * Remove pint github actions
1 parent 1f97e03 commit ee065a5

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

.github/workflows/npm-build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: npm-build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [closed]
8+
9+
jobs:
10+
npm-build:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.merged == true
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
ref: 2.x
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: "16.x"
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
27+
- name: Build assets
28+
run: yarn run production
29+
30+
- name: Commit changes
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
branch: main
34+
commit_message: >
35+
chore: build assets

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ jobs:
2121
- name: Install Composer dependencies
2222
run: composer install --prefer-dist --no-interaction
2323

24+
- name: Run Laravel Pint
25+
run: composer pint
26+
2427
- name: Execute tests
2528
run: composer pest

app/Models/Discussion.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public function getCountAllRepliesWithChildAttribute(): int
117117

118118
foreach ($this->replies()->withCount('allChildReplies')->get() as $reply) {
119119
/** @var Reply $reply */
120-
// @phpstan-ignore-next-line
121120
$count += $reply->all_child_replies_count;
122121
}
123122

app/View/Composers/TopContributorsComposer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function compose(View $view): void
1515
$topContributors = Cache::remember('contributors', now()->addWeek(), function () {
1616
return User::topContributors()
1717
->get()
18-
->filter(fn (User $contributor) => $contributor->loadCount('discussions')->discussions_count >= 1) // @phpstan-ignore-line
18+
->filter(fn (User $contributor) => $contributor->loadCount('discussions')->discussions_count >= 1)
1919
->take(5);
2020
});
2121

0 commit comments

Comments
 (0)