-
Notifications
You must be signed in to change notification settings - Fork 2
140 lines (132 loc) · 4.13 KB
/
ci.yaml
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
129
130
131
132
133
134
135
136
137
138
139
140
name: CI
on:
push:
branches:
- '*'
- '!main'
env:
BUILDER_VERSION: v0.8.22
BUILDER_SOURCE: releases
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
PACKAGE_NAME: aws-crt-kotlin
RUN: ${{ github.run_id }}-${{ github.run_number }}
# generated dockcross scripts default to `podman` when installed which
# has issues when building with docker then executing via dockcross script which
# picks up `podman` instead.
OCI_EXE: docker
jobs:
# build and test macos-arm targets: jvm, macoArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64
# cross compile native test targets for: linuxArm64, linuxX64, mingwX64
macos-arm:
runs-on: macos-14
env:
# docker not available on macos-* due to licensing
OCI_EXE: finch
steps:
- name: Setup build environment
uses: .github/actions/setup-build
- name: Configure Docker Images
run: |
./docker-images/build-all.sh
- name: Build and Test ${{ env.PACKAGE_NAME }}
run: |
$OCI_EXE images
./gradlew build
- name: Generate cross platform test binaries
run: |
./gradlew crossPlatformTestBinaries
- uses: actions/upload-artifact@v4
with:
name: test-binaries
path: |
aws-crt-kotlin/build/bin
.github/scripts
- name: Save Test Reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ runner.os }}
path: '**/build/reports'
# macosX64, iosX64
macos-x64-native:
runs-on: macos-13
steps:
- name: Setup build environment
uses: .github/actions/setup-build
with:
install-finch: false
- name: Build and Test ${{ env.PACKAGE_NAME }}
run: |
./gradlew macosX64Test iosX64Test
- name: Save Test Reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports-${{ runner.os }}
path: '**/build/reports'
# linuxX64, linuxArm64
# re-use test binaries cross compiled on previous build step
linux-native:
runs-on: macos-14
needs: macos-arm
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
os:
- ubuntu-22.04
- al2023
- al2
env:
OCI_EXE: finch
steps:
- name: Setup build environment
uses: .github/actions/setup-build
with:
do-checkout: false
- name: Download test binaries
uses: actions/download-artifact@v4
with:
name: test-binaries
path: test-binaries
- name: Test ${{ matrix.os }} on ${{ matrix.arch }}
run: |
ls -R
.github/scripts/run-container-test-binary ${{ matrix.os }} ${{ matrix.arch }} ./test-binaries/aws-crt-kotlin/build/bin
# TODO - linux jvm, windows jvm, windows native, jvm versions
# all-platforms:
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# # macos-14=m1
# os: [ubuntu-latest, macos-13, macos-14, windows-latest]
# steps:
# - name: Checkout sources
# uses: actions/checkout@v4
# with:
# submodules: true
# - name: Configure JDK
# uses: actions/setup-java@v3
# with:
# distribution: 'corretto'
# java-version: 17
# cache: 'gradle'
# # Cache the Kotlin/Native toolchain based on the input Kotlin version from version catalog
# # see https://kotlinlang.org/docs/native-improving-compilation-time.html
# - uses: actions/cache@v4
# with:
# path: |
# ~/.konan
# key: ${{ runner.os }}-konan-${{ hashFiles('gradle/libs.versions.toml') }}
# restore-keys: |
# ${{ runner.os }}-konan-
# # FIXME - we will need to migrate this to ECR to avoid throttle limits from dockerhub, for now rebuild the images during CI
# - name: Configure Docker Images
# run: |
# ./docker-images/build-all.sh
# docker images
# - name: Build and Test ${{ env.PACKAGE_NAME }}
# run: |
# docker images
# ./gradlew build