|
| 1 | +name: rethnet CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - $default-branch |
| 7 | + - "rethnet/main" |
| 8 | + paths: |
| 9 | + - "config/**" |
| 10 | + - "crates/**" |
| 11 | + - "Cargo.toml" |
| 12 | + - "rust-toolchain" |
| 13 | + pull_request: |
| 14 | + branches: ["**"] |
| 15 | + paths: |
| 16 | + - "config/**" |
| 17 | + - "crates/**" |
| 18 | + - "Cargo.toml" |
| 19 | + - "rust-toolchain" |
| 20 | + |
| 21 | +env: |
| 22 | + RUSTFLAGS: -Dwarnings |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + check: |
| 30 | + name: Check |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v3 |
| 34 | + |
| 35 | + - name: Install Rust (stable) |
| 36 | + uses: actions-rs/toolchain@v1 |
| 37 | + with: |
| 38 | + profile: minimal |
| 39 | + override: true |
| 40 | + |
| 41 | + - uses: Swatinem/rust-cache@v1 |
| 42 | + |
| 43 | + - name: Cargo check |
| 44 | + uses: actions-rs/cargo@v1 |
| 45 | + with: |
| 46 | + command: check |
| 47 | + args: --all-targets |
| 48 | + |
| 49 | + test-js: |
| 50 | + name: Test Node.js |
| 51 | + runs-on: ${{ matrix.os }} |
| 52 | + needs: check |
| 53 | + strategy: |
| 54 | + fail-fast: false |
| 55 | + matrix: |
| 56 | + os: ["ubuntu-latest", "windows-latest", "macOS-latest"] |
| 57 | + include: |
| 58 | + - RUSTFLAGS: "-Dwarnings" |
| 59 | + - os: "windows-latest" |
| 60 | + RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static" |
| 61 | + defaults: |
| 62 | + run: |
| 63 | + working-directory: crates/rethnet_evm_napi |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@v3 |
| 66 | + |
| 67 | + - uses: actions/setup-node@v2 |
| 68 | + with: |
| 69 | + node-version: 14 |
| 70 | + cache: yarn |
| 71 | + |
| 72 | + - name: Install node dependencies |
| 73 | + run: yarn --frozen-lockfile |
| 74 | + |
| 75 | + - name: Install Rust (stable) |
| 76 | + uses: actions-rs/toolchain@v1 |
| 77 | + with: |
| 78 | + profile: minimal |
| 79 | + override: true |
| 80 | + components: rustfmt |
| 81 | + |
| 82 | + - uses: Swatinem/rust-cache@v1 |
| 83 | + |
| 84 | + - name: Build |
| 85 | + run: yarn build |
| 86 | + |
| 87 | + - name: Test |
| 88 | + run: yarn test |
| 89 | + |
| 90 | + test-rs: |
| 91 | + name: Test Rust |
| 92 | + runs-on: ${{ matrix.os }} |
| 93 | + needs: check |
| 94 | + strategy: |
| 95 | + fail-fast: false |
| 96 | + matrix: |
| 97 | + os: ["ubuntu-latest", "windows-latest", "macOS-latest"] |
| 98 | + include: |
| 99 | + - RUSTFLAGS: "-Dwarnings" |
| 100 | + - os: "windows-latest" |
| 101 | + RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static" |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@v3 |
| 104 | + |
| 105 | + - name: Install Rust (stable) |
| 106 | + uses: actions-rs/toolchain@v1 |
| 107 | + with: |
| 108 | + profile: minimal |
| 109 | + override: true |
| 110 | + components: rustfmt |
| 111 | + |
| 112 | + - uses: Swatinem/rust-cache@v1 |
| 113 | + |
| 114 | + - name: Doctests |
| 115 | + uses: actions-rs/cargo@v1 |
| 116 | + env: |
| 117 | + RUSTFLAGS: ${{ matrix.RUSTFLAGS }} |
| 118 | + with: |
| 119 | + command: test |
| 120 | + args: --doc --all-features |
| 121 | + |
| 122 | + - name: Install latest nextest release |
| 123 | + uses: taiki-e/install-action@nextest |
| 124 | + |
| 125 | + - name: Test with latest nextest release |
| 126 | + uses: actions-rs/cargo@v1 |
| 127 | + env: |
| 128 | + RUSTFLAGS: ${{ matrix.RUSTFLAGS }} |
| 129 | + CARGO_INCREMENTAL: ${{ matrix.CARGO_INCREMENTAL }} |
| 130 | + with: |
| 131 | + command: nextest |
| 132 | + args: run --all-features |
0 commit comments