-
-
Notifications
You must be signed in to change notification settings - Fork 7
106 lines (89 loc) · 2.6 KB
/
pr.yml
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
name: PR
on:
pull_request:
branches: [ "*" ]
jobs:
client-build:
name: Client
runs-on: ubuntu-latest
container: node:18.17.1-bookworm
timeout-minutes: 15
defaults:
run:
working-directory: ./client
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Lint
run: npx eslint --ext .svelte,.js,.ts --ignore-path .gitignore .
- name: Formatting
run: npx prettier --check --ignore-path .gitignore --plugin-search-dir=. "./**/*.(ts|json|js|svelte)"
- name: Build
run: npm run build
env:
VITE_SENTRY_DSN: https://examplePublicKey@o0.ingest.sentry.io/0
VITE_NODE_ENV: development
VITE_API_ENDPOINT: https://jokesbapak2.reinaldyrafli.com/api/v1
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
api-build:
name: API
runs-on: ubuntu-latest
container: golang:1.21.0-bookworm
timeout-minutes: 15
services:
bucket:
image: minio/minio:edge-cicd
env:
MINIO_ROOT_USER: root
MINIO_ROOT_PASSWORD: verysecurepassword
MINIO_ACCESS_KEY: minio_access_key
MINIO_SECRET_KEY: minio_access_key
ports:
- 9000:9000
options: >-
--health-cmd "curl -f http://bucket:9000/minio/health/live"
--health-interval 45s
--health-timeout 30s
--health-retries 10
--health-start-period 120s
volumes:
- minio-data:/data
redis:
image: redis:7.0.12-bookworm
ports:
- 6379:6379
defaults:
run:
working-directory: ./api
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Installling dependencies
run: go mod download
- name: Build
run: go build main.go
- name: Run test & coverage
run: go test -v -coverprofile=coverage.out -covermode=atomic ./...
env:
ENV: development
PORT: 5000
MINIO_HOST: bucket:9000
MINIO_ACCESS_ID: root
MINIO_SECRET_KEY: verysecurepassword
REDIS_URL: redis://@redis:6379
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- uses: codecov/codecov-action@v4
with:
flags: api