diff --git a/.github/workflows/cryptouri.yml b/.github/workflows/cryptouri.yml new file mode 100644 index 0000000..5795ac0 --- /dev/null +++ b/.github/workflows/cryptouri.yml @@ -0,0 +1,61 @@ +name: cryptouri + +on: + pull_request: + paths: + - ".github/workflows/cryptouri.yml" + - "src/**" + - "Cargo.*" + push: + branches: main + +env: + CARGO_INCREMENTAL: 0 + RUSTFLAGS: "-Dwarnings" + RUSTDOCFLAGS: "-Dwarnings" + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - rust: 1.56.0 # MSRV + - rust: stable + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - run: cargo test --release + + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: 1.56.0 + components: clippy + - run: cargo clippy --all --all-features -- -D warnings + + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: RustCrypto/actions/cargo-cache@master + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + - run: cargo doc --all-features + + rustfmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: rustfmt + - run: cargo fmt --all -- --check diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 1ba3bc6..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md - -on: - pull_request: {} - push: - branches: develop - -name: Rust - -jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v1 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - - test: - name: Test Suite - strategy: - matrix: - platform: - - ubuntu-latest - - macos-latest - - windows-latest - toolchain: - - 1.39.0 - - stable - runs-on: ${{ matrix.platform }} - steps: - - name: Checkout sources - uses: actions/checkout@v1 - - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: ${{ runner.os }}-cargo-index-${{ hashFiles('Cargo.lock') }} - - - name: Install ${{ matrix.toolchain }} toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.toolchain }} - override: true - - - name: Run cargo test - uses: actions-rs/cargo@v1 - env: - CARGO_INCREMENTAL: 0 - RUSTFLAGS: -D warnings - with: - command: test - args: --release - - fmt: - name: Rustfmt - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v1 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Install rustfmt - run: rustup component add rustfmt - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Clippy - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v1 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Install clippy - run: rustup component add clippy - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings