Skip to content

Commit feaa764

Browse files
authored
Merge pull request #978 from opentensor/devnet
testnet deploy 11-13-2024 (EVM)
2 parents ca1d908 + e28dc9c commit feaa764

40 files changed

+4978
-1211
lines changed

Diff for: .github/workflows/cargo-audit.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: cargo audit
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
- unlabeled
7+
- synchronize
8+
concurrency:
9+
group: cargo-audit-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
cargo-audit:
14+
name: cargo audit
15+
runs-on: SubtensorCI
16+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
17+
steps:
18+
- name: Check-out repositoroy under $GITHUB_WORKSPACE
19+
uses: actions/checkout@v4
20+
21+
- name: Install dependencies
22+
run: |
23+
sudo apt-get update &&
24+
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
25+
26+
- name: Install Rust Stable
27+
uses: actions-rs/toolchain@v1.0.6
28+
with:
29+
toolchain: stable
30+
components: rustfmt, clippy
31+
profile: minimal
32+
33+
- name: Utilize Shared Rust Cache
34+
uses: Swatinem/rust-cache@v2.2.1
35+
with:
36+
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}
37+
38+
- name: Install cargo-audit
39+
run: cargo install --version 0.20.1 cargo-audit
40+
41+
- name: cargo audit
42+
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this

Diff for: .github/workflows/check-rust.yml

-31
Original file line numberDiff line numberDiff line change
@@ -208,37 +208,6 @@ jobs:
208208

209209
- name: cargo clippy --workspace --all-targets --all-features -- -D warnings
210210
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
211-
# runs cargo audit
212-
cargo-audit:
213-
name: cargo audit
214-
runs-on: SubtensorCI
215-
if: ${{ github.event_name != 'push' && !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
216-
steps:
217-
- name: Check-out repositoroy under $GITHUB_WORKSPACE
218-
uses: actions/checkout@v4
219-
220-
- name: Install dependencies
221-
run: |
222-
sudo apt-get update &&
223-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
224-
225-
- name: Install Rust Stable
226-
uses: actions-rs/toolchain@v1.0.6
227-
with:
228-
toolchain: stable
229-
components: rustfmt, clippy
230-
profile: minimal
231-
232-
- name: Utilize Shared Rust Cache
233-
uses: Swatinem/rust-cache@v2.2.1
234-
with:
235-
key: ubuntu-latest-${{ env.RUST_BIN_DIR }}
236-
237-
- name: Install cargo-audit
238-
run: cargo install cargo-audit
239-
240-
- name: cargo audit
241-
run: cargo audit --ignore RUSTSEC-2024-0336 # rustls issue; wait for upstream to resolve this
242211

243212
# runs cargo test --workspace
244213
cargo-test:

Diff for: .github/workflows/hotfixes.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Handle Hotfix PRs
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: write
10+
11+
jobs:
12+
handle-hotfix-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check if PR is a hotfix into `main`
16+
if: >
17+
github.event.pull_request.base.ref == 'main' &&
18+
github.event.pull_request.head.ref != 'testnet'
19+
run: |
20+
echo "Hotfix PR detected. Proceeding to label and comment."
21+
22+
- name: Add `hotfix` label
23+
if: >
24+
github.event.pull_request.base.ref == 'main' &&
25+
github.event.pull_request.head.ref != 'testnet'
26+
run: |
27+
curl -X POST \
28+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
29+
-H "Accept: application/vnd.github.v3+json" \
30+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels \
31+
-d '{"labels":["hotfix"]}'
32+
33+
- name: Add hotfix bot comment
34+
if: >
35+
github.event.pull_request.base.ref == 'main' &&
36+
github.event.pull_request.head.ref != 'testnet'
37+
run: |
38+
COMMENT_BODY=$(cat <<EOF
39+
## 🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨
40+
41+
It looks like you are trying to merge a hotfix PR into `main`. If this isn't what you wanted to do, and you just wanted to make a regular PR, please close this PR, base your changes off the `devnet-ready` branch and open a new PR into `devnet ready`.
42+
43+
If you _are_ trying to merge a hotfix PR, please complete the following essential steps:
44+
1. [ ] go ahead and get this PR into `main` merged, so we can get the change in as quickly as possible!
45+
2. [ ] merge `main` into `testnet`, bumping `spec_version`
46+
3. [ ] deploy `testnet`
47+
4. [ ] merge `testnet` into `devnet`, bumping `spec_version`
48+
5. [ ] deploy `devnet`
49+
6. [ ] merge `devnet` into `devnet-ready`
50+
51+
52+
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to \`main\`, so it is essential that you do so.
53+
EOF
54+
)
55+
56+
curl -X POST \
57+
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
58+
-H "Accept: application/vnd.github.v3+json" \
59+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
60+
-d "$(jq -n --arg body "$COMMENT_BODY" '{body: $body}')"
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)