-
Notifications
You must be signed in to change notification settings - Fork 183
167 lines (156 loc) · 5.76 KB
/
misc-tests.yml
File metadata and controls
167 lines (156 loc) · 5.76 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Miscellaneous test jobs
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org,direct
permissions:
contents: read
jobs:
pre-sandbox:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- name: Install OS Dependencies
run: |
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
sudo apt-get -y --no-install-recommends install \
cmake clang ninja-build golang
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Install seccomp dependencies
run: |
sudo apt-get -y --no-install-recommends install libseccomp-dev
- uses: actions/checkout@v6
- name: Test sandbox configuration
run: |
./tests/ci/run_presandbox_tests.sh
assert-license-statement-in-pr-description:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- if: ${{ github.event.pull_request != null }}
name: Install jq
run: |
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
sudo apt-get install -y jq
- if: ${{ github.event.pull_request != null }}
name: Check PR description
run: |
# License statement we want present.
LICENSE_STATEMENT="By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license."
# Fetches the PR description.
PR_DESCRIPTION=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r .body)
printf "PR description:\n%s" "${PR_DESCRIPTION}"
echo ""
echo ""
printf "Must contain:\n%s" "${LICENSE_STATEMENT}"
echo ""
echo ""
# Normalize line endings (convert CRLF to LF)
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | tr -d '\r')
# Escape quotes in PR description
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | sed 's/"/\\"/g; s/'"'"'/\\'"'"'/g')
# Remove all spaces and tabs
PR_DESCRIPTION=$(echo "${PR_DESCRIPTION}" | tr -d ' \t')
LICENSE_STATEMENT=$(echo "${LICENSE_STATEMENT}" | tr -d ' \t')
printf "PR description trimmed:\n%s" "${PR_DESCRIPTION}"
echo ""
echo ""
printf "Must contain trimmed:\n%s" "${LICENSE_STATEMENT}"
echo ""
echo ""
# Assert PR description contains license statement.
if printf "%s\n" "${PR_DESCRIPTION}" | grep -ixq "${LICENSE_STATEMENT}"; then
echo "Success: PR description contains license statement."
else
echo "Error: PR description does not contain the required license statement."
exit 1
fi
path-has-spaces:
if: github.repository_owner == 'aws'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-14 ]
ninja: [ 0, 1 ]
steps:
- if: ${{ matrix.os == 'windows-latest' }}
name: Install NASM
uses: ilammy/setup-nasm@v1.5.1
- uses: actions/setup-go@v6
with:
go-version: '>=1.18'
- name: Checkout
uses: actions/checkout@v6
with:
path: "path has spaces/aws-lc"
- uses: ilammy/msvc-dev-cmd@v1
- name: Setup CMake (Ninja)
if: ${{ matrix.ninja == '1' }}
uses: threeal/cmake-action@v2.1.0
with:
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build'
generator: Ninja
- name: Setup CMake
if: ${{ matrix.ninja != '1' }}
uses: threeal/cmake-action@v2.1.0
with:
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build'
- name: Build Project
run: cmake --build "path has spaces/build" --target ssl
- name: Run tests
run: cmake --build "path has spaces/build" --target run_tests
- name: Setup CMake FIPS
uses: threeal/cmake-action@v2.1.0
with:
source-dir: 'path has spaces/aws-lc'
build-dir: 'path has spaces/build-fips'
options: CMAKE_BUILD_TYPE=Release FIPS=1 BUILD_SHARED_LIBS=${{ (matrix.os == 'ubuntu-latest' && '0') || '1' }}
generator: Ninja
- name: Build Project
run: cmake --build "path has spaces/build-fips" --target all
# TODO: Fix the FIPS ACVP tests on Windows to handle spaces in the path
- if: ${{ matrix.os != 'windows-latest' }}
name: Run tests
run: cmake --build "path has spaces/build-fips" --target run_tests
git-tag-check:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Check for git tag
run: python ./util/git-tag-check/git-tag-check.py
rpmbuild:
if: github.repository_owner == 'aws'
runs-on:
- codebuild-aws-lc-ci-github-actions-${{ github.run_id }}-${{ github.run_attempt }}
image:linux-5.0
instance-size:large
steps:
- uses: actions/checkout@v6
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- uses: ./.github/actions/codebuild-docker-run
name: Run Container
with:
image: ${{ steps.login-ecr.outputs.registry }}/aws-lc/amazonlinux:latest
run: |
source /opt/compiler-env/setup-gcc.sh
./tests/ci/run_rpmbuild_tests.sh