Skip to content

Commit

Permalink
Add GitHub action for package publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhuiluo committed Jan 5, 2024
1 parent 658cf9b commit f56e30c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish package

on:
release:
types: [ published ]

env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

jobs:
cargo_publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Publish to crates.io
run: cargo publish
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
${{ runner.os }}-cargo-registry-
- name: Build
run: cargo build --verbose
run: cargo build

- name: Run tests
run: cargo test --verbose
run: cargo test
4 changes: 1 addition & 3 deletions src/utils/compute_price_impact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ pub fn compute_price_impact<TBase: CurrencyTrait, TQuote: CurrencyTrait>(
}

#[cfg(test)]

mod tests {
use crate::token;

use super::*;
use crate::token;

#[test]
fn test_compute_price_impact() {
Expand Down

0 comments on commit f56e30c

Please sign in to comment.