Skip to content

Commit 4c99e21

Browse files
ci: fix targets & add tempo check (#72)
* CI test * Hack1 * fixes * Take 2 * Temp dir * Test access * Fix * Cache * disable codeql * Bump tempo * fix: cargo deny (#73) fix deny * success doesn't need docs for now * Display clien * Move to secrets --------- Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
1 parent 9abff97 commit 4c99e21

File tree

29 files changed

+2358
-6602
lines changed

29 files changed

+2358
-6602
lines changed

.github/scripts/tempo-check.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
echo -e "\n=== TEMPO VERSION ==="
3+
cast client --rpc-url $TEMPO_RPC_URL
4+
tmp_dir=$(mktemp -d)
5+
cd "$tmp_dir"
6+
echo -e "\n=== INIT TEMPO PROJECT ==="
7+
forge init -n tempo tempo-check
8+
cd tempo-check
9+
echo -e "\n=== FORGE TEST ==="
10+
forge test
11+
echo -e "\n=== FORGE SCRIPT ==="
12+
forge script script/Mail.s.sol
13+
echo -e "\n=== CREATE AND FUND ADDRESS ==="
14+
read ADDR PK < <(cast wallet new --json | jq -r '.[0] | "\(.address) \(.private_key)"'); cast rpc tempo_fundAddress "$ADDR" --rpc-url "$TEMPO_RPC_URL"; printf "\naddress: %s\nprivate_key: %s\n" "$ADDR" "$PK"
15+
echo -e "\n=== FORGE SCRIPT DEPLOY AND VERIFY ==="
16+
forge script script/Mail.s.sol --private-key $PK --broadcast --verify
17+
echo -e "\n=== FORGE CREATE DEPLOY AND VERIFY ==="
18+
forge create src/Mail.sol:Mail --rpc-url $TEMPO_RPC_URL --private-key $PK --broadcast --verify --constructor-args 0x20c0000000000000000000000000000000000000

.github/workflows/ci.yml

Lines changed: 55 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
profile: default
2525
secrets: inherit
2626

27-
docs:
28-
uses: ./.github/workflows/docs.yml
29-
permissions:
30-
contents: read
31-
pages: write
32-
id-token: write
33-
secrets: inherit
27+
# docs:
28+
# uses: ./.github/workflows/docs.yml
29+
# permissions:
30+
# contents: read
31+
# pages: write
32+
# id-token: write
33+
# secrets: inherit
3434

3535
doctest:
3636
runs-on: depot-ubuntu-latest
@@ -44,6 +44,14 @@ jobs:
4444
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
4545
with:
4646
toolchain: stable
47+
- name: Configure Git to use GITHUB_TOKEN for GitHub
48+
env:
49+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
50+
shell: bash
51+
run: |
52+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
53+
echo "$authenticated_url"
54+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
4755
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
4856
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
4957
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
@@ -73,6 +81,14 @@ jobs:
7381
with:
7482
toolchain: nightly
7583
components: clippy
84+
- name: Configure Git to use GITHUB_TOKEN for GitHub
85+
env:
86+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
87+
shell: bash
88+
run: |
89+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
90+
echo "$authenticated_url"
91+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
7692
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
7793
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
7894
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
@@ -107,6 +123,14 @@ jobs:
107123
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
108124
with:
109125
toolchain: stable
126+
- name: Configure Git to use GITHUB_TOKEN for GitHub
127+
env:
128+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
129+
shell: bash
130+
run: |
131+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
132+
echo "$authenticated_url"
133+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
110134
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
111135
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
112136
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
@@ -126,6 +150,14 @@ jobs:
126150
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
127151
with:
128152
toolchain: stable
153+
- name: Configure Git to use GITHUB_TOKEN for GitHub
154+
env:
155+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
156+
shell: bash
157+
run: |
158+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
159+
echo "$authenticated_url"
160+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
129161
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
130162
- uses: taiki-e/install-action@537c30d2b45cc3aa3fb35e2bbcfb61ef93fd6f02 # v2
131163
with:
@@ -135,53 +167,42 @@ jobs:
135167
- run: cargo hack check
136168

137169
deny:
138-
uses: ithacaxyz/ci/.github/workflows/deny.yml@9c8d0dc20e7ad02455d3fdab2378a05f29907630 # main
139-
permissions:
140-
contents: read
141-
142-
codeql:
143-
name: analyze (${{ matrix.language }})
144-
runs-on: ubuntu-latest
170+
runs-on: depot-ubuntu-latest
145171
permissions:
146-
security-events: write
147-
actions: read
148172
contents: read
149-
strategy:
150-
fail-fast: false
151-
matrix:
152-
include:
153-
- language: actions
154-
build-mode: none
155173
steps:
156-
- name: Checkout repository
157-
uses: actions/checkout@v5
174+
- uses: actions/checkout@v5
158175
with:
159176
persist-credentials: false
160-
- name: Initialize CodeQL
161-
uses: github/codeql-action/init@v4
162-
with:
163-
languages: ${{ matrix.language }}
164-
build-mode: ${{ matrix.build-mode }}
165-
- name: Perform CodeQL Analysis
166-
uses: github/codeql-action/analyze@v4
177+
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
167178
with:
168-
category: "/language:${{matrix.language}}"
179+
toolchain: nightly
180+
- name: Configure Git to use GITHUB_TOKEN for GitHub
181+
env:
182+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
183+
shell: bash
184+
run: |
185+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
186+
echo "$authenticated_url"
187+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
188+
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad #
189+
- uses: taiki-e/install-action@cargo-deny
190+
- run: cargo deny --all-features check all
169191

170192
ci-success:
171193
runs-on: ubuntu-latest
172194
if: always()
173195
permissions: {}
174196
needs:
175197
- test
176-
- docs
198+
# - docs
177199
- doctest
178200
- typos
179201
- clippy
180202
- rustfmt
181203
- forge-fmt
182204
- crate-checks
183205
- deny
184-
- codeql
185206
timeout-minutes: 30
186207
steps:
187208
- name: Decide whether the needed jobs succeeded or failed

.github/workflows/tempo-check.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI Tempo
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
RUSTC_WRAPPER: "sccache"
11+
12+
permissions:
13+
contents: write # This is the key step
14+
15+
jobs:
16+
sanity-check:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
# Checkout the repository
21+
- uses: actions/checkout@v5
22+
with:
23+
persist-credentials: false
24+
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
25+
with:
26+
toolchain: stable
27+
28+
- name: Configure Git to use GITHUB_TOKEN for GitHub
29+
env:
30+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
31+
shell: bash
32+
run: |
33+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
34+
echo "$authenticated_url"
35+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
36+
37+
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
38+
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
39+
40+
# Build and install forge and cast
41+
- name: Build and install Forge and Cast
42+
run: |
43+
cargo install --path ./crates/forge --profile dev --force --locked
44+
cargo install --path ./crates/cast --profile dev --force --locked
45+
46+
- name: Run Tempo check
47+
env:
48+
TEMPO_RPC_URL: ${{ secrets.TEMPO_RPC_URL }}
49+
VERIFIER_URL: ${{ secrets.VERIFIER_URL }}
50+
TEMPO_TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
51+
run: |
52+
chmod +x ./.github/scripts/tempo-check.sh
53+
./.github/scripts/tempo-check.sh

.github/workflows/test.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ jobs:
6464
with:
6565
toolchain: stable
6666
target: ${{ matrix.target }}
67+
- name: Configure Git to use GITHUB_TOKEN for GitHub
68+
env:
69+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
70+
shell: bash
71+
run: |
72+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
73+
echo "$authenticated_url"
74+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
6775
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
6876
- uses: taiki-e/install-action@537c30d2b45cc3aa3fb35e2bbcfb61ef93fd6f02 # v2
6977
with:
@@ -75,6 +83,14 @@ jobs:
7583
uses: actions/setup-node@v6
7684
with:
7785
node-version: 24
86+
- name: Configure Git to use GITHUB_TOKEN for GitHub
87+
env:
88+
TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
89+
shell: bash
90+
run: |
91+
authenticated_url="https://${GITHUB_ACTOR}:${TOKEN}@github.com/"
92+
echo "$authenticated_url"
93+
git config --global url."$authenticated_url".insteadOf "ssh://git@github.com/"
7894
- name: Install Bun
7995
if: contains(matrix.name, 'external')
8096
uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2
@@ -114,4 +130,5 @@ jobs:
114130
WS_ARCHIVE_URLS: ${{ secrets.WS_ARCHIVE_URLS }}
115131
ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
116132
ARBITRUM_RPC: ${{ secrets.ARBITRUM_RPC }}
117-
run: cargo nextest run ${{ matrix.flags }}
133+
TEMPO_TOKEN: ${{ secrets.FOUNDRY_TEMPO_RELEASE_PAT }}
134+
run: cargo nextest run -p forge -p cast ${{ matrix.flags }}

0 commit comments

Comments
 (0)