-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.52 KB
/
github-actions.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
name: PR Continuous Integration - API
on:
push:
branches: [develop, master]
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
test:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
strategy:
matrix:
node-version: [20.11.0]
services:
postgres:
image: postgis/postgis:14-3.2-alpine
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis:7-alpine
ports:
- 6767:6379
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
yarn: cache
- name: Install dependencies
run: yarn
- name: Lint project
run: yarn lint
- name: Tests
run: yarn test:ci
env:
DATABASE_URL: postgres://test:test@localhost:5432/test
REDIS_URL: redis://localhost:6767
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}