-
Notifications
You must be signed in to change notification settings - Fork 127
135 lines (111 loc) · 3.45 KB
/
signoff-commit.yml
File metadata and controls
135 lines (111 loc) · 3.45 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
127
128
129
130
131
132
133
134
135
name: Signoff commit
env:
# Base for the PR
BASE_REPO: ${{ github.event.pull_request.base.repo.clone_url }}
# Repository of PR
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.clone_url }}
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
signoff-checks:
name: signoff
runs-on: warp-ubuntu-latest-arm64-32x
services:
postgres:
# make sure to change this in the shell query later in this file
image: pgvector/pgvector:0.8.0-pg17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sequin_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:6
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure PostgreSQL
env:
PGPASSWORD: postgres
run: |
set -e
psql -h localhost -U postgres -c "ALTER SYSTEM SET wal_level = 'logical';"
psql -h localhost -U postgres -c "ALTER SYSTEM SET max_connections = '200';"
docker restart $(docker ps -q --filter "ancestor=pgvector/pgvector:0.8.0-pg17")
until pg_isready -h localhost -U postgres; do
echo "Waiting for PostgreSQL to be ready..."
sleep 1
done
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.19.x'
otp-version: '28.x'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
cache: 'npm'
cache-dependency-path: 'assets/package-lock.json'
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
check-latest: true
- name: Cache Elixir deps
uses: WarpBuilds/cache@v1
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Cache build artifacts
uses: WarpBuilds/cache@v1
with:
path: _build
key: ${{ runner.os }}-build-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-build-
- name: Install Elixir dependencies
run: mix deps.get --check-locked
- name: Check formatting
run: mix format --check-formatted
- name: Compile with warnings as errors
run: MIX_ENV=prod mix compile --warnings-as-errors
- name: Run Elixir tests
run: mix test --max-cases 8
- name: Run CLI tests
run: |
set -e
cd cli
go test ./cli
go fmt ./...
go vet ./...
go build -o /dev/null ./...
- name: Install cspell
run: npm install -g cspell
- name: Run spellcheck
run: make spellcheck
- name: Run Mintlify broken-links check
run: make check-links
- name: Install assets dependencies
run: cd assets && npm ci
- name: Run Prettier check
run: cd assets && npm run format:check
- name: Run TypeScript check
run: cd assets && npm run tsc