-
Notifications
You must be signed in to change notification settings - Fork 57
128 lines (110 loc) · 4.63 KB
/
osx.yml
File metadata and controls
128 lines (110 loc) · 4.63 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
name: macOS build and test AWS Encryption SDK for C
on:
workflow_call:
jobs:
OSX:
runs-on: ${{ matrix.os }}
environment: continuous-integration
strategy:
matrix:
# macos-latest-large is the latest intel based runner
os: [macos-latest-large, ubuntu-22.04]
openssl_version: [openssl@1.1]
permissions:
id-token: write
contents: read
steps:
- name: Install OpenSSL
if: matrix.os != 'ubuntu-22.04'
run: brew install ${{ matrix.openssl_version }}
- name: Install LibCurl
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install libcurl4-openssl-dev
- name: Checkout PR
uses: actions/checkout@v4
with:
submodules: recursive
if: ${{ github.repository == 'aws/aws-encryption-sdk-c' }}
- name: Checkout PR with CI bot token
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.CI_BOT_TOKEN }}
if: ${{ github.repository == 'aws/private-aws-encryption-sdk-c-staging' }}
- name: Checkout AWS C++ SDK
uses: actions/checkout@v4
with:
repository: "aws/aws-sdk-cpp"
path: "aws-sdk-cpp"
submodules: recursive
- name: Install dependencies
if: matrix.os != 'ubuntu-22.04'
run:
brew install json-c
- name: Build and install aws-sdk-cpp
if: matrix.os != 'ubuntu-22.04'
run: |
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
mkdir -p build-aws-sdk-cpp || true
mkdir -p install || true
cd build-aws-sdk-cpp
cmake -G Xcode -DTARGET_ARCH="APPLE" -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install ../aws-sdk-cpp
xcodebuild -target ALL_BUILD
xcodebuild -target install
- name: Build and install aws-sdk-cpp
if: matrix.os == 'ubuntu-22.04'
run: |
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
mkdir -p build-aws-sdk-cpp || true
mkdir -p install || true
cd build-aws-sdk-cpp
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install ../aws-sdk-cpp
make
make install
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
role-session-name: CESDKTests
- name: Build C-ESDK
if: matrix.os != 'ubuntu-22.04'
env:
OPENSSL_VERSION: ${{ matrix.openssl_version }}
# TODO-RS: Figure out how to safely add AWS credentials and add -DAWS_ENC_SDK_END_TO_END_TESTS=ON and -DAWS_ENC_SDK_KNOWN_GOOD_TESTS=ON
run: |
mkdir build-aws-encryption-sdk-c || true
cd build-aws-encryption-sdk-c
cmake -G Xcode -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DOPENSSL_ROOT_DIR="/usr/local/opt/${OPENSSL_VERSION}" ../
xcodebuild -target ALL_BUILD
xcodebuild -scheme RUN_TESTS
- name: Build C-ESDK
if: matrix.os == 'ubuntu-22.04'
env:
OPENSSL_VERSION: ${{ matrix.openssl_version }}
# TODO-RS: Figure out how to safely add AWS credentials and add -DAWS_ENC_SDK_END_TO_END_TESTS=ON and -DAWS_ENC_SDK_KNOWN_GOOD_TESTS=ON
run: |
mkdir build-aws-encryption-sdk-c || true
cd build-aws-encryption-sdk-c
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DOPENSSL_ROOT_DIR="/usr/local/opt/${OPENSSL_VERSION}" ../
make
make test
make install
- name: Run Interop Test Vectors
if: matrix.os != 'ubuntu-22.04'
run: |
cd tests/TestVectors/
make decrypt_dafny
make encrypt
make decrypt
- name: Run Interop Test Vectors
if: matrix.os == 'ubuntu-22.04'
run: |
cd tests/TestVectors/
make test_vectors_unix
make decrypt_dafny
make encrypt
make decrypt