Skip to content

Commit 154c200

Browse files
committed
initial commit
0 parents  commit 154c200

File tree

13 files changed

+540
-0
lines changed

13 files changed

+540
-0
lines changed

.github/workflows/tilt.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: tilt
2+
on: pull_request
3+
env:
4+
HUSKY: 0
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: start minikube
11+
id: minikube
12+
uses: medyagh/setup-minikube@cea33675329b799adccc9526aa5daccc26cd5052 # pinned to v0.0.19 commit
13+
- name: install tilt
14+
run: curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash
15+
- run: tilt ci

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://bun.sh/guides/ecosystem/docker
2+
FROM oven/bun:1.2.18@sha256:2cdd9c93006af1b433c214016d72a3c60d7aa2c75691cb44dfd5250aa379986b AS base
3+
4+
WORKDIR /usr/src/app
5+
6+
FROM base AS install
7+
RUN mkdir -p /temp/prod
8+
COPY package.json bun.lock /temp/prod/
9+
RUN cd /temp/prod && bun install --frozen-lockfile --production
10+
11+
FROM base AS release
12+
COPY --from=install /temp/prod/node_modules node_modules
13+
COPY package.json package.json
14+
COPY src src
15+
16+
USER bun
17+
EXPOSE 3000/tcp
18+
ENTRYPOINT [ "bun", "start" ]
19+
20+
FROM release as test
21+

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2025 Wormhole Project Contributors
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Example Executor CI Test
2+
3+
This repo provides an example [Tilt](https://tilt.dev/) and GitHub Action for CI that can be used as a reference by [Executor](https://github.com/wormholelabs-xyz/example-messaging-executor) integrators.
4+
5+
**This software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
6+
implied. See the License for the specific language governing permissions and limitations under the License.** Or plainly
7+
spoken - this is a very complex piece of software which targets a bleeding-edge, experimental smart contract runtime.
8+
Mistakes happen, and no matter how hard you try and whether you pay someone to audit it, it may eat your tokens, set
9+
your printer on fire or startle your cat. Cryptocurrencies are a high-risk investment, no matter how fancy.

Tiltfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
analytics_settings(False)
2+
update_settings(max_parallel_updates=10)
3+
4+
k8s_yaml("tilt/anvil-base-sepolia.yaml")
5+
k8s_yaml("tilt/anvil-eth-sepolia.yaml")
6+
7+
k8s_resource(
8+
"anvil-eth-sepolia",
9+
port_forwards = [
10+
port_forward(8545, name = "RPC [:8545]"),
11+
],
12+
labels = ["anvil"],
13+
)
14+
k8s_resource(
15+
"anvil-base-sepolia",
16+
port_forwards = [
17+
port_forward(8546, 8545, name = "RPC [:8546]"),
18+
],
19+
labels = ["anvil"],
20+
)
21+
22+
docker_build(
23+
ref = "executor",
24+
context = ".",
25+
dockerfile = "./Dockerfile",
26+
target="test",
27+
only=[
28+
"package.json", "bun.lock", "src", ".env.test"
29+
]
30+
)
31+
32+
k8s_yaml("tilt/executor.yaml")
33+
k8s_resource(
34+
"executor",
35+
port_forwards = [
36+
port_forward(3000, name = "Executor [:3000]"),
37+
],
38+
resource_deps = ["anvil-eth-sepolia", "anvil-base-sepolia"],
39+
labels = ["app"],
40+
)

bun.lock

Lines changed: 187 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "example-executor-ci-test",
3+
"module": "index.ts",
4+
"type": "module",
5+
"private": true,
6+
"devDependencies": {
7+
"@types/bun": "latest"
8+
},
9+
"peerDependencies": {
10+
"typescript": "^5"
11+
},
12+
"scripts": {
13+
"start": "bun src/index.ts"
14+
},
15+
"dependencies": {
16+
"@types/express": "^5.0.3",
17+
"express": "^5.1.0"
18+
}
19+
}

src/index.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import express, { type Request, type Response } from "express";
2+
3+
const app = express();
4+
app.use(express.json());
5+
app.post("/v0/quote", async (req: Request, res: Response) => {
6+
res.status(500).send();
7+
});
8+
app.post("/v0/status/tx", async (req: Request, res: Response) => {
9+
res.status(500).send();
10+
});
11+
app.get("/v0/capabilities", async (req: Request, res: Response) => {
12+
res.status(500).send();
13+
});
14+
const server = app.listen(3000, () => {
15+
console.log(`Server is running at http://localhost:3000`);
16+
});
17+
18+
// Cleanup when the server is closing
19+
const shutdown = async () => {
20+
console.log("Shutting down servers...");
21+
server.close(async () => {
22+
process.exit(0);
23+
});
24+
};
25+
26+
process.on("SIGINT", shutdown);
27+
process.on("SIGTERM", shutdown);

tilt/anvil-base-sepolia.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: anvil-base-sepolia
6+
labels:
7+
app: anvil-base-sepolia
8+
spec:
9+
ports:
10+
- port: 8545
11+
name: rpc
12+
protocol: TCP
13+
clusterIP: None
14+
selector:
15+
app: anvil-base-sepolia
16+
---
17+
apiVersion: apps/v1
18+
kind: StatefulSet
19+
metadata:
20+
name: anvil-base-sepolia
21+
spec:
22+
selector:
23+
matchLabels:
24+
app: anvil-base-sepolia
25+
serviceName: anvil-base-sepolia
26+
replicas: 1
27+
template:
28+
metadata:
29+
labels:
30+
app: anvil-base-sepolia
31+
spec:
32+
terminationGracePeriodSeconds: 1
33+
containers:
34+
- name: anvil
35+
image: ghcr.io/foundry-rs/foundry:v1.2.3@sha256:d9133dae61c19383b72695dc7eeca29d1e7a89f1f1b5fdfd8900c660b46b4303
36+
command:
37+
- anvil
38+
- --silent
39+
- --block-time=1
40+
- --host=0.0.0.0
41+
- --fork-url=https://base-sepolia-rpc.publicnode.com
42+
- --optimism
43+
ports:
44+
- containerPort: 8545
45+
name: rpc
46+
protocol: TCP
47+
readinessProbe:
48+
tcpSocket:
49+
port: rpc
50+
---
51+

0 commit comments

Comments
 (0)