1name: CI
2
3on:
4  push:
5    branches:
6      - '*'
7      - '!master'
8
9env:
10  BUILDER_VERSION: v0.8.27
11  BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net
12  BUILDER_SOURCE: releases
13  PACKAGE_NAME: aws-checksums
14  LINUX_BASE_IMAGE: ubuntu-16-x64
15  RUN: ${{ github.run_id }}-${{ github.run_number }}
16  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
17  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18  AWS_REGION: us-east-1
19
20jobs:
21  linux-compat:
22    runs-on: ubuntu-latest
23    strategy:
24      fail-fast: false
25      matrix:
26        image:
27          - manylinux1-x64
28          - manylinux1-x86
29          - manylinux2014-x64
30          - manylinux2014-x86
31          - al2-x64
32    steps:
33        # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
34    - name: Build ${{ env.PACKAGE_NAME }}
35      run: |
36        aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
37        ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} downstream
38
39  linux-compiler-compat:
40    runs-on: ubuntu-latest
41    strategy:
42      matrix:
43        compiler:
44          - clang-3
45          - clang-6
46          - clang-8
47          - clang-9
48          - clang-10
49          - clang-11
50          - gcc-4.8
51          - gcc-5
52          - gcc-6
53          - gcc-7
54          - gcc-8
55    steps:
56      # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
57      - name: Build ${{ env.PACKAGE_NAME }}
58        run: |
59          aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
60          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=${{ matrix.compiler }} --spec downstream
61
62  clang-sanitizers:
63    runs-on: ubuntu-latest
64    strategy:
65      matrix:
66        sanitizers: [",thread", ",address,undefined"]
67    steps:
68      # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
69      - name: Build ${{ env.PACKAGE_NAME }}
70        run: |
71          aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
72          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --compiler=clang-11 --cmake-extra=-DENABLE_SANITIZERS=ON --cmake-extra=-DSANITIZERS="${{ matrix.sanitizers }}"
73
74  linux-shared-libs:
75    runs-on: ubuntu-latest
76    steps:
77      # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
78      - name: Build ${{ env.PACKAGE_NAME }}
79        run: |
80          aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
81          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON
82
83  linux-no-cpu-extensions:
84    runs-on: ubuntu-latest
85    steps:
86      # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages
87      - name: Build ${{ env.PACKAGE_NAME }}
88        run: |
89          aws s3 cp s3://aws-crt-test-stuff/ci/${{ env.BUILDER_VERSION }}/linux-container-ci.sh ./linux-container-ci.sh && chmod a+x ./linux-container-ci.sh
90          ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ env.LINUX_BASE_IMAGE }} build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
91
92  windows:
93    runs-on: windows-latest
94    steps:
95    - name: Build ${{ env.PACKAGE_NAME }} + consumers
96      run: |
97        python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
98        python builder.pyz build -p ${{ env.PACKAGE_NAME }}
99
100  windows-vc14:
101    runs-on: windows-latest
102    strategy:
103      matrix:
104        arch: [x86, x64]
105    steps:
106    - name: Build ${{ env.PACKAGE_NAME }} + consumers
107      run: |
108        python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
109        python builder.pyz build -p ${{ env.PACKAGE_NAME }} --target windows-${{ matrix.arch }} --compiler msvc-14
110
111  windows-shared-libs:
112    runs-on: windows-latest
113    steps:
114    - name: Build ${{ env.PACKAGE_NAME }} + consumers
115      run: |
116        python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
117        python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DBUILD_SHARED_LIBS=ON
118
119  windows-no-cpu-extensions:
120    runs-on: windows-latest
121    steps:
122    - name: Build ${{ env.PACKAGE_NAME }} + consumers
123      run: |
124        python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
125        python builder.pyz build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
126
127  osx:
128    runs-on: macos-latest
129    steps:
130    - name: Build ${{ env.PACKAGE_NAME }} + consumers
131      run: |
132        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
133        chmod a+x builder
134        ./builder build -p ${{ env.PACKAGE_NAME }} downstream
135
136  osx-no-cpu-extensions:
137    runs-on: macos-latest
138    steps:
139    - name: Build ${{ env.PACKAGE_NAME }} + consumers
140      run: |
141        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
142        chmod a+x builder
143        ./builder build -p ${{ env.PACKAGE_NAME }} --cmake-extra=-DUSE_CPU_EXTENSIONS=OFF
144
145  cross_compile:
146    name: Cross Compile ${{matrix.arch}}
147    runs-on: ubuntu-latest
148    strategy:
149      matrix:
150        arch: [linux-armv6, linux-armv7, linux-arm64, android-armv7]
151
152    steps:
153    - name: Build ${{ env.PACKAGE_NAME }}
154      run: |
155        python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
156        chmod a+x builder
157        ./builder build -p ${{ env.PACKAGE_NAME }} --target=${{matrix.arch}}
158
159
160