Skip to content

Commit

Permalink
Release commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shapeshed committed Oct 18, 2023
0 parents commit c970a44
Show file tree
Hide file tree
Showing 107 changed files with 19,384 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown --locked --workspace --exclude margined-testing"
wasm-debug = "build --lib --target wasm32-unknown-unknown --locked --workspace --exclude margined-testing"
unit-test = "test --lib --workspace --exclude margined-protocol --exclude margined-testing --exclude mock-query"
integration-test = "test --test integration"
fmt-check = "fmt --all -- --check"
lint = "clippy -- -D warnings"
schema = "run schema"
coverage = "llvm-cov --workspace --lcov --output-path lcov.info"

[target.wasm32-unknown-unknown]
rustflags = ["-C", "link-arg=-s"]
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Wasm Binaries

on:
push:
pull_request:
types: [opened]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
profile: minimal
override: true

- name: Compile contracts
uses: actions-rs/cargo@v1
with:
command: build
args: --release --lib --target wasm32-unknown-unknown --locked --workspace --exclude margined-testing
env:
RUSTFLAGS: "-C link-arg=-s"

- name: Run Test Tube Integration Tests
uses: actions-rs/cargo@v1
with:
command: test
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI Tests

on:
push:
pull_request:
types: [opened]

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/crates.toml
~/.cargo/crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-ci-

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
32 changes: 32 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on: [push]

name: Code Coverage

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.69.0
target: wasm32-unknown-unknown
profile: minimal
override: true

- name: Compile contracts
uses: actions-rs/cargo@v1
with:
command: build
args: --release --lib --target wasm32-unknown-unknown --locked --workspace --exclude margined-testing
env:
RUSTFLAGS: "-C link-arg=-s"
- run: cargo install cargo-tarpaulin
- run: cargo tarpaulin --out Xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV }}
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Build results
/target
/artifacts
/scripts/node_modules
/scripts/yarn.lock
/schema
/schemas
/scripts/src/types/generated

# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327)
.cargo-ok

# Text file backups
**/*.rs.bk

# macOS
.DS_Store

# IDEs
*.iml
.idea
.vscode
Loading

0 comments on commit c970a44

Please sign in to comment.