-
Notifications
You must be signed in to change notification settings - Fork 20
84 lines (71 loc) · 2.54 KB
/
cpp-libpq-integ-tests.yml
File metadata and controls
84 lines (71 loc) · 2.54 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
name: C++ libpq integration tests
permissions: {}
on:
push:
branches: [ main ]
paths:
- 'cpp/libpq/**'
- '.github/workflows/cpp-libpq-integ-tests.yml'
pull_request:
branches: [ main ]
paths:
- 'cpp/libpq/**'
- '.github/workflows/cpp-libpq-integ-tests.yml'
# Give us a button to allow running the workflow on demand for testing.
workflow_dispatch:
inputs:
tags:
description: 'Manual Workflow Run'
required: false
type: string
jobs:
cpp-libpq-integ-test:
runs-on: ubuntu-latest
permissions:
id-token: write # required by aws-actions/configure-aws-credentials
concurrency:
# Ensure only 1 job uses the workflow cluster at a time.
group: ${{ github.workflow }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install build-essential
- name: Install needed packages
run: sudo apt-get install libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev
- name: Install git
run: sudo apt-get install git
- name: Install cmake
run: sudo apt-get install cmake
- name: Install libpq
run: sudo apt-get install libpq-dev
- name: Build aws-sdk-cpp
working-directory: ./cpp/libpq
run: |
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
mkdir aws-sdk-build
mkdir aws-sdk-install
cd aws-sdk-build
cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING=OFF -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/cpp/libpq/aws-sdk-install -DBUILD_ONLY="dsql"
cmake --build . --config=Release --parallel $(nproc)
cmake --install . --config=Release
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CPP_IAM_ROLE }}
aws-region: us-east-1
- name: Build sample
working-directory: ./cpp/libpq/src
run: make libpq_example_ubuntu
- name: Configure and run integration for cpp libpq
working-directory: ./cpp/libpq/src
env:
CLUSTER_ENDPOINT: ${{ secrets.CPP_LIBPQ_CLUSTER_ENDPOINT }}
REGION: ${{ secrets.CPP_LIBPQ_CLUSTER_REGION }}
CLUSTER_USER: admin
LD_LIBRARY_PATH: /lib/x86_64-linux-gnu:/home/runner/work/aurora-dsql-samples/aurora-dsql-samples/cpp/libpq/aws-sdk-install/lib
run: |
wget https://www.amazontrust.com/repository/AmazonRootCA1.pem -O root.pem
./libpq_example