Skip to content

Commit

Permalink
chore: add Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Jul 14, 2024
1 parent 3dc2120 commit a0994be
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build canisters
run: |
rustup target add wasm32-unknown-unknown
cargo install ic-wasm
mkdir out
cargo build --target wasm32-unknown-unknown --release --locked -p ic_panda_luckypool -p ic_panda_ai
for CAN in ic_panda_luckypool ic_panda_ai
do
cp "target/wasm32-unknown-unknown/release/$CAN.wasm" out/
cp "src/$CAN/$CAN.did" "out/$CAN.did"
WASM="out/$CAN.wasm"
ic-wasm $WASM -o $WASM metadata candid:service -f "out/$CAN.did" -v public
ic-wasm $WASM -o $WASM shrink
gzip $WASM
SHA256="$(sha256sum < "out/$CAN.wasm.gz" | sed 's/ .*$//g')"
echo $SHA256 > "out/$CAN.wasm.gz.$SHA256.txt"
done
ls -lah out
- name: Release
uses: softprops/action-gh-release@v2
with:
files: out/*
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run clippy
run: cargo clippy --verbose --all-targets --all-features
- name: Run tests
run: cargo test --verbose --workspace -- --nocapture

0 comments on commit a0994be

Please sign in to comment.