|
| 1 | +--- |
| 2 | +AWSTemplateFormatVersion: 2010-09-09 |
| 3 | + |
| 4 | +Parameters: |
| 5 | + S3Bucket: |
| 6 | + Type: String |
| 7 | + |
| 8 | + PerfTestId: |
| 9 | + Type: String |
| 10 | + |
| 11 | + RepoType: |
| 12 | + Type: String |
| 13 | + |
| 14 | + Repository: |
| 15 | + Type: String |
| 16 | + |
| 17 | +Resources: |
| 18 | + CodeBuildRole: |
| 19 | + Type: "AWS::IAM::Role" |
| 20 | + Properties: |
| 21 | + AssumeRolePolicyDocument: |
| 22 | + Version: 2012-10-17 |
| 23 | + Statement: |
| 24 | + Effect: Allow |
| 25 | + Principal: |
| 26 | + Service: codebuild.amazonaws.com |
| 27 | + Action: "sts:AssumeRole" |
| 28 | + RoleName: !Sub "CR-${PerfTestId}" |
| 29 | + Policies: |
| 30 | + - PolicyName: !Sub "CP-${PerfTestId}" |
| 31 | + PolicyDocument: |
| 32 | + Version: 2012-10-17 |
| 33 | + Statement: |
| 34 | + - Action: |
| 35 | + - "s3:PutObject" |
| 36 | + Effect: Allow |
| 37 | + Resource: !Join ["/", [!Sub "arn:aws:s3:::${S3Bucket}", "*"]] |
| 38 | + - Action: |
| 39 | + - "logs:CreateLogGroup" |
| 40 | + - "logs:CreateLogStream" |
| 41 | + - "logs:PutLogEvents" |
| 42 | + Effect: Allow |
| 43 | + Resource: !Sub 'arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:/aws/codebuild/*' |
| 44 | + |
| 45 | + ReleaseBuild: |
| 46 | + Type: "AWS::CodeBuild::Project" |
| 47 | + Properties: |
| 48 | + Artifacts: |
| 49 | + Type: S3 |
| 50 | + Location: !Ref S3Bucket |
| 51 | + Path: !Ref PerfTestId |
| 52 | + Name: release |
| 53 | + Environment: |
| 54 | + ComputeType: BUILD_GENERAL1_LARGE |
| 55 | + Image: aws/codebuild/ubuntu-base:14.04 |
| 56 | + Type: LINUX_CONTAINER |
| 57 | + Name: !Sub "perf-test-release-build-${PerfTestId}" |
| 58 | + ServiceRole: !Ref CodeBuildRole |
| 59 | + Source: |
| 60 | + BuildSpec: !Sub | |
| 61 | + version: 0.2 |
| 62 | + phases: |
| 63 | + install: |
| 64 | + commands: |
| 65 | + - apt-get update -y |
| 66 | + - apt-get install -y software-properties-common |
| 67 | + - add-apt-repository ppa:ubuntu-toolchain-r/test |
| 68 | + - apt-get update -y |
| 69 | + - apt-get install -y libwww-perl g++-5 flex bison git |
| 70 | + - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 |
| 71 | + - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 1 |
| 72 | + build: |
| 73 | + commands: |
| 74 | + - echo ${Repository} > COMMIT_INFO |
| 75 | + - git rev-parse --short HEAD >> COMMIT_INFO |
| 76 | + - git log HEAD^..HEAD >> COMMIT_INFO |
| 77 | + - make -C src minisat2-download glucose-download |
| 78 | + - sed -i 's/-Wno-error=misleading-indentation//' src/config.inc |
| 79 | + - make -C src -j8 |
| 80 | + artifacts: |
| 81 | + files: |
| 82 | + - src/cbmc/cbmc |
| 83 | + - COMMIT_INFO |
| 84 | + discard-paths: yes |
| 85 | + Type: !Ref RepoType |
| 86 | + Location: !Ref Repository |
| 87 | + |
| 88 | + ProfilingBuild: |
| 89 | + Type: "AWS::CodeBuild::Project" |
| 90 | + Properties: |
| 91 | + Artifacts: |
| 92 | + Type: S3 |
| 93 | + Location: !Ref S3Bucket |
| 94 | + Path: !Ref PerfTestId |
| 95 | + Name: profiling |
| 96 | + Environment: |
| 97 | + ComputeType: BUILD_GENERAL1_LARGE |
| 98 | + Image: aws/codebuild/ubuntu-base:14.04 |
| 99 | + Type: LINUX_CONTAINER |
| 100 | + Name: !Sub "perf-test-profiling-build-${PerfTestId}" |
| 101 | + ServiceRole: !Ref CodeBuildRole |
| 102 | + Source: |
| 103 | + BuildSpec: !Sub | |
| 104 | + version: 0.2 |
| 105 | + phases: |
| 106 | + install: |
| 107 | + commands: |
| 108 | + - apt-get update -y |
| 109 | + - apt-get install -y software-properties-common |
| 110 | + - add-apt-repository ppa:ubuntu-toolchain-r/test |
| 111 | + - apt-get update -y |
| 112 | + - apt-get install -y libwww-perl g++-5 flex bison git |
| 113 | + - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 |
| 114 | + - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 1 |
| 115 | + build: |
| 116 | + commands: |
| 117 | + - echo ${Repository} > COMMIT_INFO |
| 118 | + - git rev-parse --short HEAD >> COMMIT_INFO |
| 119 | + - git log HEAD^..HEAD >> COMMIT_INFO |
| 120 | + - make -C src minisat2-download glucose-download |
| 121 | + - sed -i 's/-Wno-error=misleading-indentation//' src/config.inc |
| 122 | + - make -C src -j8 CXXFLAGS="-O2 -pg -g -finline-limit=4" LINKFLAGS="-pg" |
| 123 | + artifacts: |
| 124 | + files: |
| 125 | + - src/cbmc/cbmc |
| 126 | + - COMMIT_INFO |
| 127 | + discard-paths: yes |
| 128 | + Type: !Ref RepoType |
| 129 | + Location: !Ref Repository |
0 commit comments