--- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not use # this file except in compliance with the License. A copy of the License is # located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompanying this file. This file is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. See the License for the specific language governing permissions and # limitations under the License. version: 0.2 # This is designed to work with CodeBuild's reserved instances fleet and # curated Ec2 AMI for Ubuntu25. # # Because the Ec2 reserved instance disks persist between runs, # we need to do periodic clean up; The `nix store gc` command runs on Sunday to # prevent the disk from filling up. env: shell: bash variables: NIX_CACHE_BUCKET: "s3://s2n-tls-nixcachebucket-x86-64?region=us-west-2" NIX_INSTALLER: "https://nixos.org/nix/install" S2N_KTLS_TESTING_EXPECTED: 1 S2N_KTLS_KEYUPDATE_TESTING_EXPECTED: 1 phases: pre_build: commands: - if [[ $(date +%u) -eq 0 ]]; then nix store gc;fi # Configure S3 bucket as a nix substituter - mkdir -p ~/.config/nix - echo "extra-substituters = $NIX_CACHE_BUCKET" >> ~/.config/nix/nix.conf - echo "extra-trusted-substituters = $NIX_CACHE_BUCKET" >> ~/.config/nix/nix.conf - echo "require-sigs = false" >> ~/.config/nix/nix.conf # Load the TLS kernel module - sudo modprobe tls - echo "Checking that the TLS kernel mod loaded..."; test $(sudo lsmod|grep -c tls) = 1 build: commands: - nix develop .#awslc --command bash -c 'source ./nix/shell.sh && clean && configure && unit' - S2N_CMAKE_OPTIONS="-DASAN=ON" nix develop .#awslc --command bash -c 'source ./nix/shell.sh && clean && configure && unit' post_build: commands: - nix copy --to $NIX_CACHE_BUCKET .#cache-awslc