Skip to content

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
HsuJv committed Nov 3, 2022
1 parent 95ed913 commit 5f3af27
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,29 @@

name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build Linux
run: cargo build
- name: Build Windows
run: rustup target add x86_64-pc-windows-gnu && cargo build --target x86_64-pc-windows-gnu
- name: Build wasm32
run: rustup target add wasm32-unknown-unknown && cargo build --target wasm32-unknown-unknown
- name: Test
run: cargo test
- name: Doc test
run: cargo test --doc
19 changes: 10 additions & 9 deletions Cargo.toml
Expand Up @@ -21,14 +21,15 @@ filetime = "0.2"
ssh-key = "0.4.2"

# async
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "^1", features = ["full"] }
# [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# tokio = { version = "^1", features = ["full"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { version = "^1", features = [
"sync",
"macros",
"io-util",
"rt",
"time"
]}
getrandom = { version = "0.2", features = ["js"] }
# tokio = { version = "^1", features = [
# "sync",
# "macros",
# "io-util",
# "rt",
# "time"
# ]}

0 comments on commit 5f3af27

Please sign in to comment.