Skip to content

Commit

Permalink
chore: merge tag 'v6.0.0' into develop
Browse files Browse the repository at this point in the history
feat!: better errors with more information for the user
  • Loading branch information
Manuthor committed Jan 10, 2023
2 parents ec6533f + 5c09906 commit b81d4c8
Show file tree
Hide file tree
Showing 18 changed files with 349 additions and 228 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Audit
on:
schedule:
# At 8:30 every day
- cron: "30 8 * * *"
- cron: 30 8 * * *

jobs:
audit:
Expand Down
105 changes: 27 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,41 @@ name: CI checks
on: push

jobs:
lint:
name: Lint
cargo-lint:
uses: Cosmian/reusable_workflows/.github/workflows/cargo-lint.yml@main
with:
toolchain: stable
cargo-semver:
uses: Cosmian/reusable_workflows/.github/workflows/cargo-semver.yml@main
with:
toolchain: stable
cargo-dry-publish:
uses: Cosmian/reusable_workflows/.github/workflows/cargo-publish.yml@main
with:
toolchain: stable
publish: false
wasm:
runs-on: ubuntu-latest

steps:
- run: sudo apt-get update && sudo apt-get install libsodium-dev
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
# Using a rustfmt.toml with unstable features, need nightly
toolchain: stable
override: true
components: rustfmt, clippy

# Ensure all code has been formatted with rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check --color always
- name: Static analysis
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings
- name: Static analysis all features
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings

test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release

no-std:
name: Check no-std target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-unknown-unknown

steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
- run: rustup target add ${{ matrix.target }}
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --target ${{ matrix.target }}

doc-links:
name: Nightly lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true

# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crate.
- name: Check intra-doc links
uses: actions-rs/cargo@v1
with:
command: doc
args: --document-private-items
args: --verbose --target wasm32-unknown-unknown

cargo-publish:
needs:
- cargo-lint
- cargo-semver
- cargo-dry-publish
- wasm
uses: Cosmian/reusable_workflows/.github/workflows/cargo-publish.yml@main
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
with:
toolchain: stable
16 changes: 0 additions & 16 deletions .github/workflows/release_on_tags.yml

This file was deleted.

139 changes: 139 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
# Pre-requisites:
# pip install pre-commit conventional-pre-commit
# pre-commit install
# pre-commit install --install-hooks -t commit-msg
# pre-commit autoupdate

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
exclude: tests_data
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.1.1
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4
hooks:
- id: prettier
stages: [commit]
exclude_types:
- yaml
- markdown

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.2
hooks:
- id: markdownlint-fix
args: [--disable=MD013, --disable=MD024, --disable=MD041, --disable=MD046]

- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
rev: v1.1.2
hooks:
- id: htmlhint
- id: dockerfile_lint
- id: markdown-toc
args: [--bullets='-'] # comment this to refresh TOC

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
args: [--mapping, '2', --sequence, '4', --offset, '2']

- repo: https://github.com/crate-ci/typos
rev: v1.13.6
hooks:
- id: typos

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.2
hooks:
- id: check-github-actions
- id: check-github-workflows

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
exclude: ^.git/
- id: remove-tabs
exclude: ^.git/

- repo: https://github.com/sirosen/texthooks
rev: 0.4.0
hooks:
- id: fix-smartquotes
- id: fix-ligatures
- id: fix-spaces
- id: forbid-bidi-controls
- id: macro-expand

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck

- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: cargo-check

- repo: https://github.com/Cosmian/git-hooks.git
rev: v1.0.5
hooks:
- id: cargo-update
- id: clippy-autofix-all
- id: clippy-autofix-pedantic
- id: clippy-autofix-nursery
- id: clippy-autofix-others
- id: cargo-tests-all
- id: unstable-cargo-format
- id: clippy-all-targets-all-features
- id: cargo-dry-publish
args: [--allow-dirty]
- id: dprint-toml-fix

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: file-contents-sorter
- id: fix-byte-order-marker
- id: fix-encoding-pragma
- id: mixed-line-ending
args: [--fix=lf]
- id: name-tests-test
- id: requirements-txt-fixer
- id: sort-simple-yaml
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
# avoid clash with `double-quote-string-fixer`
args: [--skip-string-normalization]
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

---

## Unreleased
## [6.0.0] - 2023-01-10

### Added

Expand Down Expand Up @@ -105,7 +105,7 @@ All notable changes to this project will be documented in this file.

### Added

- `DhKeyPair` which represents an asymmetric key pair in a space wher the
- `DhKeyPair` which represents an asymmetric key pair in a space where the
Computational Diffie-Helman problem is intractable

### Changed
Expand Down
Loading

0 comments on commit b81d4c8

Please sign in to comment.