Skip to content

Commit

Permalink
enhancement/soteria_ci (#108)
Browse files Browse the repository at this point in the history
* try 2. copy pasted from drift

* no cd

* working
  • Loading branch information
LexBrill authored and acamill committed Feb 15, 2022
1 parent 0f30d46 commit 55c41e8
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/soteria.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Soteria

on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

env:
CARGO_TERM_COLOR: always
SOLANA_VERSION: "1.8.12"
PROGRAM_PATH: "programs/"

jobs:
build:
name: Soteria Scan
runs-on: ubuntu-latest
steps:
- name: Checkout changes
uses: actions/checkout@v2

- name: Cache Solana Version
uses: actions/cache@v2
id: solana-cache
with:
path: |
~/.rustup
~/.cache/solana
~/.local/share/solana
key: solana-v${{ env.SOLANA_VERSION }}

- name: Cache Soteria Build
uses: Swatinem/rust-cache@v1
with:
target-dir: ${{ env.PROGRAM_PATH }}.coderrect/build # Cache build files for performance

- name: Download Solana
if: steps.solana-cache.outputs.cache-hit != 'true' # Skip this step if matched cached version is available
run: |
echo Downloading Solana v${{ env.SOLANA_VERSION }}... 🧬
sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_VERSION }}/install)"
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
echo Configuring bpf toolchain...
(cd /home/runner/.local/share/solana/install/active_release/bin/sdk/bpf/scripts; ./install.sh)
shell: bash

- name: Download Soteria # Always grab the latest version
run: |
echo Downloading Soteria... 🔬
sh -c "$(curl -k https://supercompiler.xyz/install)"
export PATH=$PWD/soteria-linux-develop/bin/:$PATH
echo "$PWD/soteria-linux-develop/bin" >> $GITHUB_PATH
shell: bash

- name: Run Soteria
run: |
echo Running Soteria... 👾
soteria -analyzeAll .
echo Done!
shell: bash

0 comments on commit 55c41e8

Please sign in to comment.