-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (108 loc) · 3.2 KB
/
pull-request.yml
File metadata and controls
126 lines (108 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Pull Request
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
env:
CI: "true"
jobs:
lint:
name: Lintowanie
runs-on: ubuntu-latest
environment: Integration
env:
NODE_ENV: development
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
unit-test:
name: Unit tests (coverage)
runs-on: ubuntu-latest
needs: lint
environment: Integration
env:
NODE_ENV: development
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Run unit tests with coverage
run: npm run test:coverage
- name: Upload unit test coverage
uses: actions/upload-artifact@v4
with:
name: vitest-coverage
path: coverage
e2e-test:
name: Playwright E2E tests
runs-on: ubuntu-latest
needs: lint
environment: Tests
env:
NODE_ENV: development
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
E2E_USERNAME_ID: ${{ secrets.E2E_USERNAME_ID }}
E2E_USERNAME: ${{ secrets.E2E_USERNAME }}
E2E_PASSWORD: ${{ secrets.E2E_PASSWORD }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install chromium
- name: Run Playwright tests
run: npm run test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report
status-comment:
name: Status PR
runs-on: ubuntu-latest
needs:
- lint
- unit-test
- e2e-test
permissions:
contents: write
pull-requests: write
steps:
- name: Comment PR status
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
✅ Wszystkie kontrole zakończone pomyślnie.
- Lintowanie: ✅
- Testy jednostkowe (z coverage): ✅
- Testy end-to-end: ✅