-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.78 KB
/
custom.yaml
File metadata and controls
53 lines (49 loc) · 1.78 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
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/github-workflow.json
name: Test with Postgres
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
push:
# branches:
# - main
jobs:
test-run:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Run Postgres
run: |
sudo tee -a /etc/postgresql/16/main/postgresql.conf <<EOF
shared_preload_libraries = 'auto_explain'
auto_explain.log_min_duration = 0
auto_explain.log_analyze = true
auto_explain.log_verbose = true
auto_explain.log_buffers = true
auto_explain.log_format = 'json'
logging_collector = on
log_directory = '/var/log/postgresql'
log_filename = 'postgres.log'
EOF
sudo tee /etc/postgresql/16/main/pg_hba.conf > /dev/null <<EOF
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
local all all peer
EOF
sudo systemctl start postgresql.service
sudo -u postgres createuser -s -d -r -w query_doctor
sudo -u postgres createdb testing
sudo chmod 666 /var/log/postgresql/postgres.log
- name: Apply SQL file
run: |
psql -h localhost -U query_doctor -d testing -f bootstrap.sql
- name: Run local GitHub Action
uses: ./
with:
# TODO: support pg 16 explicitly
postgres-version: 17
env:
GITHUB_TOKEN: ${{ github.token }}
SOURCE_DATABASE_URL: postgres://query_doctor@localhost:5432/testing
LOG_PATH: /var/log/postgresql/postgres.log
SITE_API_ENDPOINT: ${{ vars.SITE_API_ENDPOINT }}