1name: CI (Linux) 2 3on: [push, pull_request] 4 5jobs: 6 build_and_test: 7 8 runs-on: ubuntu-latest 9 10 steps: 11 - uses: actions/checkout@v2 12 13 - name: rustfmt 14 uses: actions-rs/cargo@v1 15 with: 16 command: fmt 17 args: --all -- --check 18 19 - name: check build (async) 20 uses: actions-rs/cargo@v1 21 with: 22 command: check 23 args: --all --bins --examples --tests 24 25 - name: tests (async) 26 uses: actions-rs/cargo@v1 27 timeout-minutes: 40 28 with: 29 command: test 30 args: --all --no-fail-fast -- --nocapture 31 32 - name: check build (is_sync) 33 uses: actions-rs/cargo@v1 34 with: 35 command: check 36 args: --features=is_sync --all --bins --examples --tests 37 38 - name: tests (is_sync) 39 uses: actions-rs/cargo@v1 40 timeout-minutes: 40 41 with: 42 command: test 43 args: --features=is_sync --all --no-fail-fast -- --nocapture 44 45 doc: 46 runs-on: ubuntu-latest 47 steps: 48 - uses: actions/checkout@v2 49 50 - name: doc (async) 51 uses: actions-rs/cargo@v1 52 env: 53 RUSTDOCFLAGS: -Dwarnings 54 with: 55 command: doc 56 args: --all --no-deps 57 58 - name: doc (is_sync) 59 uses: actions-rs/cargo@v1 60 env: 61 RUSTDOCFLAGS: -Dwarnings 62 with: 63 command: doc 64 args: --all --no-deps --features=is_sync 65 66 publish: 67 name: Publish Package 68 needs: build_and_test 69 if: startsWith(github.ref, 'refs/tags/v') 70 runs-on: ubuntu-latest 71 steps: 72 - uses: actions/checkout@v2 73 74 - name: login 75 env: 76 SUPER_SECRET: ${{ secrets.CARGO_TOKEN }} 77 run: cargo login "$SUPER_SECRET" 78 shell: bash 79 80 - name: publish 81 uses: actions-rs/cargo@v1 82 with: 83 command: publish 84