-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
48 lines (43 loc) · 3.07 KB
/
action.yml
File metadata and controls
48 lines (43 loc) · 3.07 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
name: "Setup Postgres AdventureWorksLT Database"
description: "GitHub Action to setup Postgres AdventureWorksLT database"
branding:
icon: "database"
color: "yellow"
inputs:
username:
description: "The username to create for the database"
required: false
default: "admin"
password:
description: "The password to use for the database user"
required: true
postgres_version:
description: "The version of Postgres to use (14/15/16/17/18)"
required: false
default: "18"
runs:
using: "composite"
steps:
- name: Setup Postgres
uses: openentity/setup-postgres@v8
with:
database: "AdventureWorksLT"
username: ${{ inputs.username }}
password: "${{ inputs.password }}"
postgres-version: "${{ inputs.postgres_version }}"
id: postgres
- shell: pwsh
run: |
echo "Init AdventureWorksLT database..."
psql "${{ steps.postgres.outputs.connection-uri }}" -f "${{ github.action_path }}/init/init.sql"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"Address`" FROM '${{ github.action_path }}/init/SalesLT.Address.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"Customer`" FROM '${{ github.action_path }}/init/SalesLT.Customer.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"CustomerAddress`" FROM '${{ github.action_path }}/init/SalesLT.CustomerAddress.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"ProductCategory`" FROM '${{ github.action_path }}/init/SalesLT.ProductCategory.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"ProductModel`" FROM '${{ github.action_path }}/init/SalesLT.ProductModel.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"ProductDescription`" FROM '${{ github.action_path }}/init/SalesLT.ProductDescription.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"ProductModelProductDescription`" FROM '${{ github.action_path }}/init/SalesLT.ProductModelProductDescription.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"Product`" FROM '${{ github.action_path }}/init/SalesLT.Product.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"SalesOrderHeader`" FROM '${{ github.action_path }}/init/SalesLT.SalesOrderHeader.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
psql "${{ steps.postgres.outputs.connection-uri }}" -c "COPY `"SalesLT`".`"SalesOrderDetail`" FROM '${{ github.action_path }}/init/SalesLT.SalesOrderDetail.csv' WITH DELIMITER ',' NULL 'NULL' CSV HEADER"
echo "Done init AdventureWorksLT database."