|
1 | 1 | name: Build-CI
|
2 | 2 | on:
|
3 | 3 | pull_request:
|
4 |
| - branches: [develop, main] |
| 4 | + branches: [Develop, main-net-runtime] |
5 | 5 | push:
|
6 |
| - branches: [develop, main] |
| 6 | + branches: [Develop, main-net-runtime] |
7 | 7 | jobs:
|
8 | 8 | build:
|
9 |
| - runs-on: self-hosted |
| 9 | + runs-on: ubuntu-latest |
10 | 10 | steps:
|
11 | 11 | - uses: actions/checkout@v2
|
12 | 12 | - name: Cache Rust Dependecies
|
13 | 13 | uses: actions/cache@v2
|
14 | 14 | with:
|
15 |
| - path: | |
16 |
| - ~/.cargo/registry |
17 |
| - ~/.cargo/git |
18 |
| - target |
19 |
| - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
20 |
| - - name: Install toolchain |
21 |
| - run: ./scripts/init.sh |
| 15 | + path: | |
| 16 | + ~/.cargo/registry |
| 17 | + ~/.cargo/git |
| 18 | + target |
| 19 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 20 | + - name: Add wasm toolchain |
| 21 | + uses: actions-rs/toolchain@v1 |
| 22 | + with: |
| 23 | + toolchain: nightly |
| 24 | + target: wasm32-unknown-unknown |
| 25 | + override: true |
| 26 | + - name: Add fmt |
| 27 | + # v1.5.0 includes fixes of closures formatting |
| 28 | + run: | |
| 29 | + cd .. |
| 30 | + git clone --depth 1 https://github.com/rust-lang/rustfmt |
| 31 | + cd rustfmt |
| 32 | + git fetch --tags |
| 33 | + git checkout v1.5.0 |
| 34 | + export CFG_RELEASE=nightly |
| 35 | + export CFG_RELEASE_CHANNEL=nightly |
| 36 | + cargo clean -p rustfmt-nightly |
| 37 | + cargo install --path . --force |
| 38 | + cd ../Polkadex |
22 | 39 | - name: Build Project
|
23 | 40 | run: |
|
24 |
| - cargo clean |
25 |
| - cargo build --release --features runtime-benchmarks |
26 |
| - cargo build |
| 41 | + cargo clean |
| 42 | + # cargo build --release --features runtime-benchmarks |
| 43 | + RUSTFLAGS="-D warnings" cargo build |
| 44 | + - name: Check Formatting |
| 45 | + run: cargo fmt --check |
| 46 | + - name: Check Clippy |
| 47 | + run: | |
| 48 | + rustup component add clippy --toolchain=nightly |
| 49 | + cargo +nightly clippy -- -D warnings |
27 | 50 | - name: Test Project
|
28 | 51 | run: cargo test
|
29 | 52 | - name: Run Cargo Trampulin
|
30 |
| - if: github.event_name == 'push' |
31 | 53 | uses: actions-rs/[email protected]
|
32 | 54 | with:
|
33 |
| - version: '0.15.0' |
34 |
| - args: '--exclude polkadex-node node-polkadex-runtime polkadex-primitives --workspace' |
| 55 | + args: '--exclude polkadex-node node-polkadex-runtime --workspace --timeout 180' |
35 | 56 | - name: Upload to codecov.io
|
36 |
| - if: github.event_name == 'push' |
37 |
| - |
| 57 | + uses: codecov/codecov-action@v3 |
38 | 58 | with:
|
39 | 59 | token: ${{secrets.CODECOV_TOKEN}}
|
| 60 | + fail_ci_if_error: true |
40 | 61 | - name: Archive code coverage results
|
41 | 62 | if: github.event_name == 'push'
|
42 | 63 | uses: actions/upload-artifact@v1
|
|
0 commit comments