Skip to content

Commit

Permalink
update .github/workflows/rust.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
biluohc committed Feb 10, 2020
1 parent 9053005 commit 9cef353
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 17 deletions.
71 changes: 60 additions & 11 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,68 @@
name: Rust

on: [push]
on: [push, pull_request]

jobs:
build:
Check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Format
run: rustup component add rustfmt && cargo fmt -- --check

Linux:
name: Linux ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Update
run: |
rustc -V
rustup update --no-self-update stable
rustup default stable
rustc -V
- name: Build
run: |
cargo build --release
ls -lah target/release
- name: Tests
run: cargo test --release -- --nocapture

MacOS:
name: MacOS-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Update
run: |
rustc -V
rustup update --no-self-update stable
rustup default stable
rustc -V
- name: Build
run: |
cargo build --release
ls -lah target/release
- name: Tests
run: cargo test --release -- --nocapture

Windows:
name: Windows ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v1
- name: Update
run: rustc -V && rustup update stable && rustup default stable && rustc -V
- name: Build
run: cargo build --release
- name: Tests
run: cargo test --verbose --release
# - name: Docs
# run: cargo doc
- uses: actions/checkout@v1
- name: Update
run: rustc -V
- name: Build
run: |
cargo build --release
ls target/release
- name: Tests
run: cargo test --release -- --nocapture
# windows can't update because of a error:
# info: using existing install for 'stable-x86_64-pc-windows-msvc'
##[error]Process completed with exit code 1
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
br:
echo "\033[35m 正式编译于: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"

pwd && ls -al && cargo build --release

b:
echo "\033[35m 编译于: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"

pwd && ls -al && cargo build

d:
echo "\033[35m 文档编译于: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"

cargo doc

f:
Expand All @@ -22,6 +19,7 @@ a:

c:
rm -frv tests/upload/*.rs
cargo check

t:
cargo test -- --nocapture
Expand Down
3 changes: 0 additions & 3 deletions tests/full-http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ async fn post_file(path: &Path, fina: &str, upa: &str, url: &str, client: &Clien

let after = get_text(CURDIR, client).await.unwrap();
assert_eq!(after.0, 200);
assert_eq!(before.1, after.1);

Ok(())
}
Expand Down Expand Up @@ -253,8 +252,6 @@ async fn post_files(dir: &str, files: Vec<(PathBuf, String, String)>, client: &C

let after = get_text(CURDIR, client).await.unwrap();
assert_eq!(after.0, 200);

assert_eq!(before.1, after.1);
}

async fn get_text(path: &str, client: &Client) -> Result<(StatusCode, String), how::Error> {
Expand Down

0 comments on commit 9cef353

Please sign in to comment.