Skip to content

Commit d826708

Browse files
authored
Migrate analytics job to be GitHub triggered (#2779)
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.
1 parent 41ccd52 commit d826708

File tree

3 files changed

+43
-19
lines changed

3 files changed

+43
-19
lines changed

.github/workflows/analytics.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: aws-lc-analytics
2+
on:
3+
push:
4+
branches: [main]
5+
tags-ignore: ['**']
6+
permissions:
7+
contents: read
8+
env:
9+
GOPROXY: https://proxy.golang.org,direct
10+
jobs:
11+
analytics:
12+
name: analytics-${{ matrix.arch }}
13+
runs-on:
14+
- codebuild-aws-lc-ci-github-actions-${{ github.run_id }}-${{ github.run_attempt }}
15+
image:${{ matrix.arch == 'x86_64' && 'linux-5.0' || matrix.arch == 'aarch64' && 'arm-3.0' }}
16+
instance-size:large
17+
strategy:
18+
matrix:
19+
arch: [x86_64, aarch64]
20+
env:
21+
ANALYTICS_BRANCH: ${{ github.ref }}
22+
steps:
23+
- uses: actions/checkout@v5
24+
- name: Login to Amazon ECR
25+
id: login-ecr
26+
uses: aws-actions/amazon-ecr-login@v2
27+
- uses: ./.github/actions/codebuild-docker-run
28+
name: Run Container
29+
with:
30+
image: ${{ steps.login-ecr.outputs.registry }}/aws-lc/amazonlinux:2
31+
env: |
32+
ANALYTICS_BRANCH
33+
run: |
34+
source /opt/compiler-env/setup-gcc-7.sh
35+
./tests/ci/run_analytics.sh

tests/ci/cdk/cdk/codebuild/github_ci_analytics_omnibus.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@ version: 0.2
66
# Doc for batch https://docs.aws.amazon.com/codebuild/latest/userguide/batch-build-buildspec.html#build-spec.batch.build-list
77
batch:
88
build-list:
9-
10-
- identifier: amazonlinux2_gcc7x_x86_64_analytics
11-
buildspec: ./tests/ci/codebuild/common/run_simple_target.yml
9+
- identifier: migrated
10+
buildspec: ./tests/ci/codebuild/common/no_op.yml
1211
env:
1312
type: LINUX_CONTAINER
14-
privileged-mode: true
15-
compute-type: BUILD_GENERAL1_LARGE
16-
image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:amazonlinux-2_gcc-7x_latest
17-
variables:
18-
AWS_LC_CI_TARGET: "tests/ci/run_analytics.sh"
19-
20-
- identifier: amazonlinux2_gcc7x_arm_analytics
21-
buildspec: ./tests/ci/codebuild/common/run_simple_target.yml
22-
env:
23-
type: ARM_CONTAINER
24-
privileged-mode: true
25-
compute-type: BUILD_GENERAL1_LARGE
26-
image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-aarch:amazonlinux-2_gcc-7x_latest
27-
variables:
28-
AWS_LC_CI_TARGET: "tests/ci/run_analytics.sh"
13+
privileged-mode: false
14+
compute-type: BUILD_GENERAL1_SMALL
15+
image: aws/codebuild/standard:7.0

tests/ci/run_analytics.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ source tests/ci/common_posix_setup.sh
1010
# In case there is a weird change over time this recorded additional information about the host to the logs.
1111
lscpu
1212

13-
branch=$(echo "$CODEBUILD_WEBHOOK_TRIGGER" | cut -d '/' -f2)
13+
# The expected format here is inline with github.ref context value which passes
14+
# the push events reference as `refs/heads/<branch_name>`
15+
branch=$(echo "${ANALYTICS_BRANCH:?}" | cut -d '/' -f3)
1416
common_dimensions="Branch=${branch}"
1517

1618
commit_timestamp=$(git show -s --format=%ct)

0 commit comments

Comments
 (0)