-
Notifications
You must be signed in to change notification settings - Fork 3
116 lines (101 loc) · 2.92 KB
/
checks.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
107
108
109
110
111
112
113
114
115
116
name: Check
on:
pull_request:
branches:
- main
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
env:
NODE_OPTIONS: --max_old_space_size=6144
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare
uses: ./.github/utils/app
with:
build: false
- name: Run Linter
# run: pnpm exec eslint ${{ steps.changed-files.outputs.all_changed_files }}
run: pnpm lint
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare
uses: ./.github/utils/app
with:
build: false
- name: Run Formatter
# run: pnpm exec prettier --check --ignore-unknown ${{ steps.changed-files.outputs.all_changed_files }}
run: pnpm format
unit:
name: Unit Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgis/postgis:15-3.4-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
directus:
image: directus/directus:10.8.3
env:
DB_CLIENT: pg
DB_HOST: postgres
DB_PORT: postgres
DB_USER: postgres
DB_PASSWORD: postgres
DB_DATABASE: postgres
LOG_LEVEL: debug
KEY: 0fda9121-269d-44bd-91f2-4ff05be14b4b
SECRET: 86cb4a76-a4c6-4ce7-8181-b0445d95675c
CACHE_ENABLED: false
ADMIN_EMAIL: [email protected]
ADMIN_PASSWORD: d1r3ctu5
ports:
- 8055:8055
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
# Vitest uses `git diff` under the hood to find the changed files in it's `--changed`
# option, which in turn means we need to fetch the full git history so git is able to diff
fetch-depth: 0
- name: Prepare
uses: ./.github/utils/app
- name: Prepare env
run: cp .env.example .env
- name: Run Tests
# run: pnpm test:ci <- includes the seed and run
run: pnpm test
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
with:
dest: "./logs"
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@master
with:
name: logs.tgz
path: ./logs.tgz