-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (70 loc) · 2.27 KB
/
Copy pathci.yaml
File metadata and controls
70 lines (70 loc) · 2.27 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
name: ci
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
ports:
- "5432:5432"
env:
POSTGRES_PASSWORD: secretpassword
POSTGRES_DB: batondb
env:
BATON_LOG_LEVEL: debug
BATON_CONFIG_PATH: ./examples/postgres-test.yml
DB_USER: postgres
DB_PASSWORD: secretpassword
DB_HOST: localhost
DB_PORT: 5432
DB_DATABASE: batondb
BATON_PROVISIONING: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install postgres client
run: sudo apt install postgresql-client
- name: Import sql into postgres
run: psql -h localhost --user postgres -d batondb -f ./test/postgres-init.sql
env:
PGPASSWORD: secretpassword
- name: Build baton-sql
run: go build ./cmd/baton-sql
- name: Run sync tests
uses: ConductorOne/github-workflows/actions/sync-test@v2
with:
connector: ./baton-sql
baton-entitlement: 'role:admin:member'
baton-principal: john.smith
baton-principal-type: user
- name: Run account provisioning tests
uses: ConductorOne/github-workflows/actions/account-provisioning@v3
with:
connector: ./baton-sql
account-email: robert.tables2@example.com
account-login: "robert'); drop table users; --"
- name: Run update user attributes action test
run: |
./baton-sql --invoke-action=update_user_attributes --invoke-action-args='{
"user_id": "jane.doe",
"attrs": {
"first_name": "Janet",
"job_title": "Senior Software Engineer"
},
"attrs_update_mask": ["first_name", "job_title"]
}'
- name: Verify update user attributes action
run: |
psql -h localhost --user postgres -d batondb -t -c "SELECT attr_first_name, attr_job_title FROM users WHERE username = 'jane.doe'" | grep -q "Janet.*Senior Software Engineer"
env:
PGPASSWORD: secretpassword