|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | build: |
11 | | - name: build |
12 | | - runs-on: ${{ matrix.os }} |
13 | | - strategy: |
14 | | - fail-fast: false |
15 | | - matrix: |
16 | | - os: [macos-latest, ubuntu-latest] |
| 11 | + runs-on: ubuntu-22.04 |
17 | 12 | steps: |
18 | | - - uses: actions/checkout@v2 |
| 13 | + - uses: actions/checkout@v3 |
| 14 | + |
| 15 | + - name: Set up cargo cache |
| 16 | + uses: actions/cache@v3 |
| 17 | + continue-on-error: false |
| 18 | + with: |
| 19 | + path: | |
| 20 | + ~/.cargo/bin/ |
| 21 | + ~/.cargo/registry/index/ |
| 22 | + ~/.cargo/registry/cache/ |
| 23 | + ~/.cargo/git/db/ |
| 24 | + target/ |
| 25 | + key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }} |
| 26 | + restore-keys: ${{ runner.os }}-cargo-release- |
| 27 | + |
19 | 28 | - name: Build |
20 | | - run: cargo build --verbose |
21 | | - - name: Run tests |
22 | | - run: cargo test --verbose |
| 29 | + run: cargo build --release --verbose |
| 30 | + |
| 31 | + - name: Upload binary |
| 32 | + uses: actions/upload-artifact@v3 |
| 33 | + with: |
| 34 | + name: bin |
| 35 | + path: target/release/rshijack |
23 | 36 |
|
24 | 37 | cross: |
25 | 38 | runs-on: ubuntu-latest |
@@ -68,18 +81,36 @@ jobs: |
68 | 81 | name: rshijack-${{ matrix.arch.name }} |
69 | 82 | path: target/${{ matrix.arch.name }}/release/rshijack |
70 | 83 |
|
71 | | - clippy: |
72 | | - name: clippy |
73 | | - runs-on: ubuntu-latest |
| 84 | + unit-test: |
| 85 | + runs-on: ${{ matrix.os }} |
| 86 | + strategy: |
| 87 | + fail-fast: false |
| 88 | + matrix: |
| 89 | + os: [macos-latest, ubuntu-22.04] |
74 | 90 | steps: |
75 | | - - uses: actions/checkout@v2 |
76 | | - - uses: actions-rs/toolchain@v1 |
77 | | - with: |
78 | | - profile: minimal |
79 | | - toolchain: stable |
80 | | - override: true |
81 | | - components: clippy |
82 | | - - uses: actions-rs/cargo@v1 |
| 91 | + - uses: actions/checkout@v3 |
| 92 | + |
| 93 | + - name: Set up cargo cache |
| 94 | + uses: actions/cache@v3 |
| 95 | + continue-on-error: false |
83 | 96 | with: |
84 | | - command: clippy |
85 | | - args: --workspace --tests -- --deny warnings |
| 97 | + path: | |
| 98 | + ~/.cargo/bin/ |
| 99 | + ~/.cargo/registry/index/ |
| 100 | + ~/.cargo/registry/cache/ |
| 101 | + ~/.cargo/git/db/ |
| 102 | + target/ |
| 103 | + key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} |
| 104 | + restore-keys: ${{ runner.os }}-cargo-debug- |
| 105 | + |
| 106 | + - name: Run clippy |
| 107 | + run: cargo clippy -- -D warnings |
| 108 | + - name: Run tests |
| 109 | + run: cargo test --verbose |
| 110 | + |
| 111 | + fmt: |
| 112 | + runs-on: ubuntu-22.04 |
| 113 | + steps: |
| 114 | + - uses: actions/checkout@v3 |
| 115 | + - name: Run cargo fmt |
| 116 | + run: cargo fmt --all -- --check |
0 commit comments