Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/codebuild-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,65 +24,67 @@

jobs:
build:
# Runner exists only for aws-cdk repo
if: github.repository == 'aws/aws-cdk'
runs-on: codebuild-aws-cdk-github-actions-runner-${{ github.run_id }}-${{ github.run_attempt }}

env:
PR_BUILD: true

steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: "18"
cache: "yarn"

- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Load Docker images
id: docker-cache
uses: actions/cache/restore@v4
with:
path: |
~/.docker-images.tar
key: docker-cache-${{ runner.os }}

- name: Restore Docker images
if: ${{ steps.docker-cache.outputs.cache-hit }}
run: docker image load --input ~/.docker-images.tar

- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
~/.s3buildcache
key: s3buildcache-${{ runner.os }}

- name: Configure system settings
run: |
(command -v sysctl || sudo apt-get update && sudo apt-get install -y procps) && \
sudo sysctl -w vm.max_map_count=2251954

- name: Build
run: /bin/bash ./build.sh --ci

- name: Run Rosetta
run: /bin/bash ./scripts/run-rosetta.sh

- name: Check for uncommitted changes
run: git diff-index --exit-code --ignore-space-at-eol --stat HEAD

- name: Export Docker images
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
run: docker image save --output ~/.docker-images.tar $(docker image list --format '{{ if ne .Repository "<none>" }}{{ .Repository }}{{ if ne .Tag "<none>" }}:{{ .Tag }}{{ end }}{{ else }}{{ .ID }}{{ end }}')

- name: Cache Docker images
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
uses: actions/cache/save@v4
with:
path: |
~/.docker-images.tar
key: docker-cache-${{ runner.os }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading