Skip to content

Commit 1455366

Browse files
authored
feat: add github actions workflows ++ fix soteria arithmetic exploits (#8)
1 parent 6e519ba commit 1455366

File tree

11 files changed

+440
-124
lines changed

11 files changed

+440
-124
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Setup Solana"
2+
description: "Setup Solana"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- uses: actions/cache@v2
7+
name: Cache Solana Tool Suite
8+
id: cache-solana
9+
with:
10+
path: |
11+
~/.cache/solana/
12+
~/.local/share/solana/
13+
key: solana-${{ runner.os }}-v0000-${{ env.SOLANA_CLI_VERSION }}
14+
- run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_CLI_VERSION }}/install)"
15+
shell: bash
16+
- run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
17+
shell: bash
18+
- run: solana-keygen new --no-bip39-passphrase
19+
shell: bash
20+
- run: solana config set --url localhost
21+
shell: bash

.github/actions/setup/action.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: "Setup"
2+
description: "Setup"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- run: sudo apt-get update && sudo apt-get install -y pkg-config build-essential libudev-dev
7+
shell: bash

.github/workflows/build.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- gh-actions
7+
pull_request:
8+
branches:
9+
- master
10+
env:
11+
SOLANA_CLI_VERSION: 1.9.4
12+
NODE_VERSION: 17.0.1
13+
jobs:
14+
build-and-test:
15+
name: Build and test programs
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: ./.github/actions/setup/
20+
- uses: ./.github/actions/setup-solana/
21+
- uses: actions/cache@v2
22+
name: Cache Cargo registry + index
23+
id: cache-anchor
24+
with:
25+
path: |
26+
~/.cargo/bin/
27+
~/.cargo/registry/index/
28+
~/.cargo/registry/cache/
29+
~/.cargo/git/db/
30+
./target/
31+
key: cargo-${{ runner.os }}-anchor-${{ hashFiles('**/Cargo.lock') }}
32+
- run: cargo install --git https://github.com/project-serum/anchor --tag v0.20.1 anchor-cli --locked --force
33+
- run: cd mev-payment && yarn
34+
- run: yarn global add mocha@^9.0.3
35+
- name: test
36+
working-directory: ./mev-payment
37+
run: anchor test
38+
- uses: reinismu/clippy-check@master
39+
with:
40+
working-directory: ./mev-payment/programs
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
soteria:
43+
needs: build-and-test
44+
name: Runs soteria analysis
45+
runs-on: ubuntu-20.04
46+
steps:
47+
- uses: actions/checkout@v2
48+
- uses: ./.github/actions/setup/
49+
- uses: ./.github/actions/setup-solana/
50+
- name: Install latest nightly
51+
uses: actions-rs/toolchain@v1
52+
with:
53+
toolchain: nightly
54+
override: true
55+
- run: cd ./mev-payment && sh -c "$(curl -k https://supercompiler.xyz/install)" && cargo build-bpf
56+
- run: cd ./mev-payment && ./soteria-linux-develop/bin/soteria -analyzeAll .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

0 commit comments

Comments
 (0)