Skip to content

Commit e068013

Browse files
Copy ci config from the strata repo. In the next commits, iterating on it from this state.
1 parent 95624a2 commit e068013

19 files changed

+1195
-0
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Bug Report
2+
description: Create a bug report
3+
labels: ["bug"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this bug report! Please provide as much detail as possible.
9+
10+
If you believe you have found a vulnerability, please provide details [here](mailto:security@alpenlabs.io) instead.
11+
- type: textarea
12+
id: what-happened
13+
attributes:
14+
label: Describe the bug
15+
description: |
16+
A clear and concise description of what the bug is.
17+
18+
If the bug is in a crate you are using (i.e. you are not running the standard `strata` binaries) please mention that as well.
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: reproduction-steps
23+
attributes:
24+
label: Steps to reproduce
25+
description: Please provide any steps you think might be relevant to reproduce the bug.
26+
placeholder: |
27+
Steps to reproduce:
28+
29+
1. Start '...'
30+
2. Then '...'
31+
3. Check '...'
32+
4. See error
33+
validations:
34+
required: true
35+
- type: dropdown
36+
id: platform
37+
attributes:
38+
label: Platform(s)
39+
description: If the issue is with the full node, what platform(s) did this occur on?
40+
multiple: true
41+
options:
42+
- Linux (x86)
43+
- Linux (ARM)
44+
- Mac (Intel)
45+
- Mac (Apple Silicon)
46+
- Windows (x86)
47+
- Windows (ARM)
48+
validations:
49+
required: false
50+
- type: textarea
51+
id: fullnode-version
52+
attributes:
53+
# FIXME: use `--version` instead
54+
label: What is the sha256 checksum of the full node you are running?
55+
validations:
56+
required: false
57+
- type: input
58+
attributes:
59+
label: If you've built the full node from source, provide the full command you used
60+
validations:
61+
required: false
62+
- type: checkboxes
63+
id: terms
64+
attributes:
65+
label: Code of Conduct
66+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/alpenlabs/strata/blob/main/CONTRIBUTING.md#code-of-conduct)
67+
options:
68+
- label: I agree to follow the Code of Conduct
69+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/alpenlabs/strata/discussions
5+
about: Please ask and answer questions here to keep the issue tracker clean.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Feature request
2+
description: Suggest a feature
3+
labels: ["enhancement"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Please ensure that the feature has not already been requested in the issue tracker.
9+
- type: textarea
10+
attributes:
11+
label: Describe the feature
12+
description: |
13+
Please describe the feature and what it is aiming to solve, if relevant.
14+
15+
If the feature is for a crate, please include a proposed API surface.
16+
validations:
17+
required: true
18+
- type: textarea
19+
attributes:
20+
label: Additional context
21+
description: Add any other context to the feature (like screenshots, resources)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Description
2+
3+
<!--
4+
Provide a brief summary of the changes and the motivation behind them.
5+
-->
6+
7+
### Type of Change
8+
9+
<!--
10+
Select the type of change your PR introduces (put an `x` in all that apply):
11+
-->
12+
13+
- [ ] Bug fix (non-breaking change which fixes an issue)
14+
- [ ] New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
15+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
16+
- [ ] Documentation update
17+
- [ ] Refactor
18+
- [ ] New or updated tests
19+
- [ ] Dependency Update
20+
21+
## Notes to Reviewers
22+
23+
<!--
24+
Anything in particular you want to note that will help reviewers fulfill their role
25+
in reviewing this PR?
26+
-->
27+
28+
## Checklist
29+
30+
<!--
31+
Ensure all the following are checked:
32+
-->
33+
34+
- [ ] I have performed a self-review of my code.
35+
- [ ] I have commented my code where necessary.
36+
- [ ] I have updated the documentation if needed.
37+
- [ ] My changes do not introduce new warnings.
38+
- [ ] I have added tests that prove my changes are effective or that my feature works.
39+
- [ ] New and existing tests pass with my changes.
40+
41+
## Related Issues
42+
43+
<!--
44+
Link any related issues (e.g., `closes #123`, `fixes #456`).
45+
-->

.github/actions/cleanup/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Cleanup GitHub runner bloat
2+
description: "Removes unnecessary files and frees up disk space on the runner."
3+
inputs: {}
4+
outputs: {}
5+
6+
runs:
7+
using: "composite"
8+
steps:
9+
- name: Cleanup space
10+
shell: bash
11+
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
12+
run: |
13+
echo "Starting cleanup..."
14+
sudo rm -rf /usr/share/dotnet
15+
sudo rm -rf /usr/local/lib/android
16+
sudo rm -rf /usr/local/.ghcup
17+
sudo rm -rf /opt/ghc
18+
sudo rm -rf "/usr/local/share/boost"
19+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Update nightly Rust
2+
on:
3+
schedule:
4+
- cron: "29 17 1 * *" # At 17:29 on day-of-month 1.
5+
workflow_dispatch: # allows manual triggering
6+
env:
7+
CARGO_TERM_COLOR: always
8+
jobs:
9+
format:
10+
name: Update nightly Rustc
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
- uses: dtolnay/rust-toolchain@nightly
17+
- name: Update rust-toolchain.toml to use latest nightly
18+
run: |
19+
set -xe
20+
21+
# Get the latest nightly date.
22+
# If the latest nightly date is not the same as the current nightly date,
23+
# rustup will default to the latest nightly up to TODAY.
24+
#
25+
# Example: If the latest nightly is 2023-07-01, and the TODAY is 2023-07-02,
26+
# then rustup will default to nightly-2023-07-01.
27+
TODAY="$(date +%Y-%m-%d)"
28+
29+
# Update the nightly version in the rust-toolchain.toml file.
30+
echo "Updating rust-toolchain.toml to use nightly-$TODAY"
31+
sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-$TODAY\"/" rust-toolchain.toml
32+
33+
# Update the nightly date in the environment.
34+
echo "nightly_date=${TODAY}" >> "$GITHUB_ENV"
35+
36+
# Maybe there is no new nightly.
37+
# In this case don't make an empty PR.
38+
if ! git diff --exit-code > /dev/null; then
39+
echo "Updated nightly. Opening PR."
40+
echo "changes_made=true" >> "$GITHUB_ENV"
41+
else
42+
echo "Attempted to update nightly but the latest-nightly date did not change. Not opening any PR."
43+
echo "changes_made=false" >> "$GITHUB_ENV"
44+
fi
45+
- name: Create Pull Request
46+
if: env.changes_made == 'true'
47+
uses: peter-evans/create-pull-request@v7
48+
env:
49+
NIGHTLY_DATE: ${{ env.nightly_date }}
50+
with:
51+
author: Update Nightly Rustc Bot <no-reply@alpenlabs.io>
52+
committer: Update Nightly Rustc Bot <no-reply@alpenlabs.io>
53+
title: Automated update to rustc (to nightly-$NIGHTLY_DATE)
54+
body: |
55+
Automated update to Rust nightly by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action
56+
commit-message: Automated update to Rust nightly-$NIGHTLY_DATE
57+
branch: create-pull-request/automated-nightly-update

.github/workflows/cron-zizmor.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Automated GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *" # Run every day at midnight
6+
7+
jobs:
8+
zizmor:
9+
name: zizmor latest via PyPI
10+
runs-on: ubuntu-latest
11+
permissions:
12+
security-events: write
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
persist-credentials: false
18+
19+
- name: Install the latest version of uv
20+
uses: astral-sh/setup-uv@v5
21+
22+
- name: Run zizmor 🌈
23+
run: uvx zizmor --format sarif . > results.sarif
24+
env:
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Upload SARIF file
28+
uses: github/codeql-action/upload-sarif@v3
29+
with:
30+
sarif_file: results.sarif
31+
category: zizmor

.github/workflows/dependencies.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Runs `cargo update` periodically.
2+
3+
name: Update Dependencies
4+
5+
on:
6+
schedule:
7+
# Run at the first of every month
8+
- cron: "0 0 1 * *"
9+
workflow_dispatch: # Needed so we can run it manually
10+
11+
env:
12+
AUTHOR: Update Cargo.lock Bot <no-reply@alpenlabs.io>
13+
BRANCH: create-pull-request/automated-cargo-update
14+
TITLE: "chore(deps): monthly `cargo update`"
15+
BODY: |
16+
Automation to keep dependencies in `Cargo.lock` current.
17+
18+
<details><summary><strong>cargo update log</strong></summary>
19+
<p>
20+
21+
```log
22+
$cargo_update_log
23+
```
24+
25+
</p>
26+
</details>
27+
28+
jobs:
29+
update:
30+
name: Update
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: write # Needed to create commits
34+
pull-requests: write # Needed to create a PR
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
39+
- uses: dtolnay/rust-toolchain@nightly
40+
with:
41+
toolchain: nightly-2024-07-27
42+
43+
- name: cargo update
44+
# Remove first line that always just says "Updating crates.io index"
45+
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
46+
47+
- name: craft commit message and PR body
48+
id: msg
49+
run: |
50+
cargo_update_log="$(cat cargo_update.log)"
51+
export cargo_update_log
52+
53+
{
54+
echo "commit_message<<EOF"
55+
echo "$TITLE"
56+
echo ""
57+
echo "$cargo_update_log"
58+
echo ""
59+
echo "EOF"
60+
} >> "$GITHUB_OUTPUT"
61+
62+
{
63+
echo "body<<EOF"
64+
echo "$BODY" | envsubst
65+
echo "EOF"
66+
} >> "$GITHUB_OUTPUT"
67+
68+
- name: Create Pull Request
69+
uses: peter-evans/create-pull-request@v7
70+
with:
71+
add-paths: ./Cargo.lock
72+
commit-message: ${{ steps.msg.outputs.commit_message }}
73+
author: ${{ env.AUTHOR }}
74+
title: ${{ env.TITLE }}
75+
body: ${{ steps.msg.outputs.body }}
76+
branch: ${{ env.BRANCH }}

.github/workflows/docs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docs
2+
3+
on:
4+
pull_request:
5+
merge_group:
6+
push:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
docs:
14+
name: Generate docs
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 60
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
- uses: dtolnay/rust-toolchain@nightly
22+
with:
23+
toolchain: nightly-2024-07-27
24+
- uses: Swatinem/rust-cache@v2
25+
with:
26+
cache-on-failure: true
27+
- name: Check docs leaving the dependencies out
28+
env:
29+
RUSTDOCFLAGS: --show-type-layout --enable-index-page -Zunstable-options -A rustdoc::private-doc-tests -D warnings
30+
run: cargo doc --workspace --no-deps

0 commit comments

Comments
 (0)