-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (91 loc) · 3.04 KB
/
transformations_aws_compliance_free_postgres.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
name: "Test AWS Compliance Free Policies: Postgres"
on:
pull_request:
paths:
- "transformations/aws/compliance-free/**"
- ".github/workflows/transformations_aws_compliance_free_postgres.yml"
- "transformations/aws/macros/**"
- "transformations/aws/models/**"
- "transformations/macros/**"
push:
branches:
- main
paths:
- "transformations/aws/compliance-free/**"
- ".github/workflows/transformations_aws_compliance_free_postgres.yml"
- "transformations/aws/macros/**"
- "transformations/aws/models/**"
- "transformations/macros/**"
jobs:
transformations-aws-compliance-free:
name: transformations/aws/compliance-free
timeout-minutes: 30
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./transformations/aws/compliance-free
services:
postgres:
image: postgres:11
env:
POSTGRES_PASSWORD: pass
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_CQ_BOT }}
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "./transformations/aws/compliance-free/requirements.txt"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@v3
with:
version: v4.0.0
# Test unpacked version
- name: Migrate DB
run: cloudquery migrate tests/postgres.yml
env:
CQ_DSN: postgresql://postgres:pass@localhost:5432/postgres
- name: Run Policies
run: |
dbt run --target dev-pg --profiles-dir ./tests
# Test packed version
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: scripts/dbt-pack/package-lock.json
- name: Install Dependencies
run: npm ci
working-directory: ./scripts/dbt-pack
- name: Pack DBT
working-directory: ./scripts/dbt-pack
run: node index.js dbt-pack --project-dir=../../transformations/aws/compliance-free
- name: Unzip Packed DBT
run: unzip -o build/aws_compliance_free.zip -d build/aws_compliance_free
- name: Run Unpacked DBT
working-directory: ./transformations/aws/compliance-free/build/aws_compliance_free
run: |
dbt run --target dev-pg --profiles-dir ../../tests
- name: Gen docs
run: |
make gen-docs
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore: Update readme"
file_pattern: 'transformations/aws/compliance-free/README.md'