Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CODEOWNERS file for automatic PR assignment
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @rollkit/binary-builders
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: 'bug'
assignees: ''
---

## Description

A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## System information

- OS: [e.g. Ubuntu 22.04]
- Lumen version: [e.g. v0.1.0]
- Rust version: [e.g. 1.81.0]

## Logs

```
Please paste any relevant log output here
```

## Additional context

Add any other context about the problem here.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: 'enhancement'
assignees: ''
---

## Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

## Describe the solution you'd like

A clear and concise description of what you want to happen.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

## Additional context

Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/assets/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# syntax=docker/dockerfile:1
# CI-specific Dockerfile for E2E tests

FROM ubuntu:24.04

# Copy the pre-built binary
COPY dist/lumen /usr/local/bin/lumen

# Make it executable
RUN chmod +x /usr/local/bin/lumen

# Create a non-root user
RUN useradd -m -s /bin/bash lumen

# Switch to non-root user
USER lumen
WORKDIR /home/lumen

# Expose default ports
EXPOSE 8545 8546 30303 6060 9001

# Set the entrypoint
ENTRYPOINT ["/usr/local/bin/lumen"]
53 changes: 53 additions & 0 deletions .github/branch-protection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Branch Protection Rules

This document outlines the recommended branch protection rules for the `main` branch.

## Required Status Checks

The following GitHub Actions workflows should pass before merging:

### Critical Checks
- `lint / lint success`
- `unit / unit success`
- `integration / integration success`
- `e2e / e2e`
- `lint-actions / actionlint`

### Optional but Recommended
- `docker / build` (for releases)

## Settings

1. **Require a pull request before merging**
- Require approvals: 1
- Dismiss stale pull request approvals when new commits are pushed
- Require review from CODEOWNERS

2. **Require status checks to pass before merging**
- Require branches to be up to date before merging
- Status checks listed above

3. **Require conversation resolution before merging**

4. **Require signed commits** (optional but recommended)

5. **Include administrators** (optional, depends on team preference)

6. **Restrict who can push to matching branches**
- Add team/users who can push directly (for emergency fixes)

## Setting Up

To apply these rules:

1. Go to Settings → Branches in your GitHub repository
2. Add a rule for the `main` branch
3. Configure the settings as described above
4. Save changes

## Merge Queue (Optional)

Consider enabling GitHub's merge queue for better handling of multiple PRs:
- Maximum PRs to merge: 5
- Minimum PRs to merge: 1
- Wait time: 5 minutes
33 changes: 33 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2
updates:
# Enable version updates for Rust dependencies
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
reviewers:
- "lumen-maintainers"
labels:
- "dependencies"
- "rust"
commit-message:
prefix: "chore"
include: "scope"

# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
reviewers:
- "lumen-devops-team"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
include: "scope"
35 changes: 35 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Description

<!-- Please include a summary of the changes and the related issue. -->

## Type of Change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Refactoring

## Related Issues

<!-- Link to any related issues -->
Fixes #(issue)

## Checklist

- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published

## Testing

<!-- Describe the tests you ran to verify your changes -->

## Additional Notes

<!-- Add any additional notes or context about the PR here -->
61 changes: 61 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Runs `cargo update` periodically.

name: Update Dependencies

on:
schedule:
# Run weekly
- cron: "0 0 * * SUN"
workflow_dispatch:
# Needed so we can run it manually

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: cargo-update
TITLE: "chore(deps): weekly `cargo update`"
BODY: |
Automation to keep dependencies in `Cargo.lock` current.

<details><summary><strong>cargo update log</strong></summary>
<p>

```log
$cargo_update_log
```

</p>
</details>

jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly

- name: cargo update
# Remove first line that always just says "Updating crates.io index"
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log

- name: craft commit message and PR body
id: msg
run: |
export cargo_update_log="$(cat cargo_update.log)"

echo "commit_message<<EOF" >> $GITHUB_OUTPUT
printf "%s\n\n%s\n" $TITLE $cargo_update_log >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
add-paths: ./Cargo.lock
commit-message: ${{ steps.msg.outputs.commit_message }}
title: ${{ env.TITLE }}
body: ${{ steps.msg.outputs.body }}
branch: ${{ env.BRANCH }}
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Publishes the Docker image.

name: docker

on:
workflow_dispatch: {}
push:
tags:
- v*

env:
REPO_NAME: ${{ github.repository_owner }}/lumen
IMAGE_NAME: ${{ github.repository_owner }}/lumen
CARGO_TERM_COLOR: always
DOCKER_IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/lumen
DOCKER_USERNAME: ${{ github.actor }}

jobs:
build:
name: build and push
runs-on: ubuntu-24.04
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@cross
- name: Log in to Docker
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io --username ${DOCKER_USERNAME} --password-stdin
- name: Set up Docker builder
run: |
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
docker buildx create --use --name cross-builder
- name: Build and push image
run: make docker-build-push
44 changes: 44 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Runs E2E tests.

name: e2e

on:
pull_request:
merge_group:
push:
branches: [main]
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
e2e:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: taiki-e/install-action@nextest
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Build Lumen
run: |
cargo build --profile release --locked --bin lumen

- name: Run E2E tests
run: |
cargo nextest run \
--locked \
--workspace \
-E "package(lumen-tests)" \
--no-capture
env:
RUST_LOG: debug
Loading