Continue CI steps even when one of them fails (#15)

* Continue CI steps even when one of them fails
* Build all features in CI
* Test all features in CI
This commit is contained in:
gusto 2022-12-01 18:46:27 +02:00 committed by GitHub
parent 0db0544a77
commit ee0085e873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 102 additions and 12 deletions

View File

@ -1,7 +1,11 @@
# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
on: [push, pull_request]
# These tasks are supposed to run when updating the main branch.
# The steps are identical to those that run on PRs, but this script includes macos environment.
on:
push:
branches: [main]
name: CI
name: Main branch updates check
jobs:
check:
@ -17,15 +21,16 @@ jobs:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: false
continue-on-error: true
with:
command: check
test:
name: Test Suite
strategy:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest] # macos-latest removed because 1 min on macos is x10 on GH runtime.
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
@ -40,13 +45,15 @@ jobs:
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: false
continue-on-error: true
with:
command: build
args: --all-features
- uses: actions-rs/cargo@v1
continue-on-error: false
continue-on-error: true
with:
command: test
args: --all-features
lints:
name: Rust lints
@ -64,14 +71,14 @@ jobs:
- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: false
continue-on-error: true
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: false
continue-on-error: true
with:
command: clippy
args: -- --deny warnings

85
.github/workflows/pr.yml vendored Normal file
View File

@ -0,0 +1,85 @@
# copy of https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
# Steps for checking PRs.
on:
pull_request:
branches:
- "*"
name: PR check
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: check
test:
name: Test Suite
if: ${{ !startsWith(github.event.pull_request.title, '[WIP]') && !contains(github.event.label.name, 'DO NOT MERGE') }}
strategy:
fail-fast: false # all OSes should be tested even if one fails (default: true)
matrix:
os: [ubuntu-latest, windows-latest] # macos-latest removed because 1 min on macos is x10 on GH runtime.
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-go@v3 # we need go to build go-waku
with:
go-version: '1.19'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: build
args: --all-features
- uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: test
args: --all-features
lints:
name: Rust lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: true
with:
command: clippy
args: -- --deny warnings

View File

@ -2,12 +2,11 @@ use std::collections::HashMap;
use std::marker::PhantomData;
// std
// crates
use crate::storage::backends::{StorageSerde, StorageTransaction};
use async_trait::async_trait;
use bytes::Bytes;
use thiserror::Error;
// internal
use super::StorageBackend;
use super::{StorageBackend, StorageSerde, StorageTransaction};
#[derive(Debug, Error)]
#[error("Errors in MockStorage should not happen")]

View File

@ -8,8 +8,7 @@ use sled::transaction::{
ConflictableTransactionResult, TransactionError, TransactionResult, TransactionalTree,
};
// internal
use super::StorageBackend;
use crate::storage::backends::{StorageSerde, StorageTransaction};
use super::{StorageBackend, StorageSerde, StorageTransaction};
/// Sled backend setting
#[derive(Clone)]