SkillAgentSearch skills...

Lambci

A continuous integration system built on AWS Lambda

Install / Use

/learn @lambci/Lambci
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Note: This repo is in maintenance mode as we assess whether Serverless GitHub Actions might provide a better experience going forward

<img align="left" src="https://lambci.s3.amazonaws.com/assets/logo-310x310.png" width="180px" height="180px">

LambCI

Serverless continuous integration

Launch CloudFormation Stack Serverless App Repository LambCI Build Status Gitter


Automate your testing and deployments with:

  • 1000 concurrent builds out of the box (can request more)
  • No maintenance of web servers, build servers or databases
  • Zero cost when not in use (ie, 100% utilization)
  • Easy to integrate with the rest of your AWS resources

Contents


What is it?

LambCI is a package you can upload to AWS Lambda that gets triggered when you push new code or open pull requests on GitHub and runs your tests (in the Lambda environment itself) – in the same vein as Jenkins, Travis or CircleCI.

It integrates with Slack, and updates your Pull Request and other commit statuses on GitHub to let you know if you can merge safely.

LambCI in action

It can be easily launched and kept up-to-date as a CloudFormation Stack, or you can manually create the different resources yourself.

Installed languages

  • Node.js 12.x (including npm/npx)
  • Python 3.6 (including pip)
  • Gcc 7.2 (including c++)

Supported languages

Prerequisites

Current Limitations (due to the Lambda environment itself)

  • No root access
  • 500MB disk space
  • 15 min max build time
  • Bring-your-own-binaries – Lambda has a limited selection of installed software
  • 3.0GB max memory
  • Linux only

You can get around many of these limitations by configuring LambCI to send tasks to an ECS cluster where you can run your builds in Docker.

Installation

You don't need to clone this repository – the easiest way to install LambCI is to deploy it from the Serverless Application Repository or directly spin up a CloudFormation stack. This will create a collection of related AWS resources, including the main LambCI Lambda function and DynamoDB tables, that you can update or remove together – it should take around 3 minutes to spin up.

You can use multiple repositories from the one stack, and you can run multiple stacks with different names side-by-side too (eg, lambci-private and lambci-public).

If you'd prefer to run your stack after cloning this repository, you can use npm run deploy – this depends on AWS SAM CLI being installed.

1. Create a GitHub token

You can create a token in the Personal access tokens section of your GitHub settings. If you're setting up LambCI for an organization, it might be a good idea to create a separate GitHub user dedicated to running automated builds (GitHub calls these "machine users") – that way you have more control over which repositories this user has access to.

Click the Generate new token button and then select the appropriate access levels.

LambCI only needs read access to your code, but unfortunately GitHub webhooks have rather crude access mechanisms and don't have a readonly scope for private repositories – the only options is to choose repo ("Full control").

<img alt="Private GitHub access" src="https://lambci.s3.amazonaws.com/assets/private_github_2.png" width="555" height="318">

If you're only using LambCI for public repositories, then you just need access to commit statuses:

<img alt="Public GitHub access" src="https://lambci.s3.amazonaws.com/assets/public_github_2.png" width="538" height="216">

Then click the "Generate token" button and GitHub will generate a 40 character hex OAuth token.

2. Create a Slack token (optional)

You can obtain a Slack API token by creating a bot user (or you can use the token from an existing bot user if you have one) – this direct link should take you there, but you can navigate from the App Directory via Browse Apps > Custom Integrations > Bots.

Pick any name, and when you click "Add integration" Slack will generate an API token that looks something like xoxb-<numbers>-<letters>

<img alt="Add Slack bot" src="https://lambci.s3.amazonaws.com/assets/slack_bot_2.png" width="622" height="528">

3. Launch the LambCI CloudFormation stack

You can either deploy it from the Serverless Application Repository or use this direct CloudFormation link or navigate in your AWS Console to Services > CloudFormation, choose "Create Stack" and use the S3 link:

<img alt="CloudFormation Step 1" src="https://lambci.s3.amazonaws.com/assets/cfn1_2.png" width="404" height="63">

Then click Next where you can enter a stack name (lambci is a good default), API tokens and a Slack channel – you'll also need to make up a secret to secure your webhook and enter it as the GithubSecret – any randomly generated value is good here, but make sure you still have it handy to enter when you setup your webhooks in GitHub later on.

<img alt="CloudFormation Step 2" src="https://lambci.s3.amazonaws.com/assets/cfn2_3.png" width="689" height="558">

Click Next, and then Next again on the Options step (leaving the default options selected), to get to the final Review step:

<img alt="CloudFormation Step 3" src="https://lambci.s3.amazonaws.com/assets/cfn3_2.png" width="689" height="538">

Check the acknowledgments, click Create Change Set and then Execute to start the resource creation process:

<img alt="CloudFormation Step 4" src="https://lambci.s3.amazonaws.com/assets/cfn4.png">

Once your stack is created (should be done in a few minutes) you're ready to add the webhook to any repository you like!

You can get the WebhookUrl from the Outputs of the CloudFormation stack:

<img alt="CloudFormation Step 5" src="https://lambci.s3.amazonaws.com/assets/cfn5.png" width="758" height="177">

Then create a new Webhook in any GitHub repo you want to trigger under Settings > Webhooks (https://github.com/<user>/<repo>/settings/hooks/new) and enter the WebhookUrl from above as the Payload URL, ensure Content type is application/json and enter the GithubSecret you generated in the first step as the Secret:

<img alt="GitHub Webhook Step 1" src="https://lambci.s3.amazonaws.com/assets/webhook1.png" width="498" height="652">

Assuming you want to respond to Pull Requests as well as Pushes, you'll need to choose "Let me select individual events", and check Pushes and Pull requests.

<img alt="GitHub Webhook Step 2" src="https://lambci.s3.amazonaws.com/assets/webhook2.png" width="772" height="261">

Then "Add webhook" and you're good to go!

By default LambCI only responds to pushes on the master branch and pull requests (you can configure this), so try either of those – if nothing happens, then check Services > CloudWatch > Logs in the AWS Console and see the Questions section below.

Installing as a nested stack in another CloudFormation stack

You can also embed LambCI in your own stack, using a AWS::Serverless::Application resource:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Resources:
  LambCI:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: ar

Related Skills

View on GitHub
GitHub Stars4.0k
CategoryDevelopment
Updated1mo ago
Forks185

Languages

Shell

Security Score

95/100

Audited on Feb 28, 2026

No findings