From 855e807461746518edde4551433330c1aca2fd95 Mon Sep 17 00:00:00 2001 From: Yuxiang Cao Date: Tue, 31 Oct 2023 15:01:13 -0700 Subject: [PATCH] ci: add initial CI --- .github/ISSUE_TEMPLATE/bug_report.md | 29 +++++ .github/ISSUE_TEMPLATE/dependency-update.md | 33 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 23 ++++ .github/dependabot.yml | 15 +++ .github/workflows/build.yml | 112 ++++++++++++++++++++ .gitignore | 12 ++- 6 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/dependency-update.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..80d1dac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,29 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Checklist** +* [ ] I've searched the issue tracker for similar bugs. + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Use one of the examples to connect to `....` +2. ... +3. See error + +**Applicable Version(s)** +A list of versions and platforms you've tested with. + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/dependency-update.md b/.github/ISSUE_TEMPLATE/dependency-update.md new file mode 100644 index 0000000..952f25b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/dependency-update.md @@ -0,0 +1,33 @@ +--- +name: Dependency Update +about: Request a dependency be updated +title: Dependency update request +labels: '' +assignees: '' + +--- + + + +**Checklist** +* [ ] I've searched the issue tracker for similar requests +* [ ] I've confirmed my request is for a semver-incompatible update + +**Is your dependency update request related to a problem? Please describe.** +A clear and concise description of what the problem is. + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..65494eb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Checklist** +* [ ] I've searched the issue tracker for similar requests + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ce1ffcc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: +- package-ecosystem: cargo + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + groups: + crates-io: + patterns: + - "*" +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6a32e7d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,112 @@ +name: rustls-mbedcrypto-provider + +permissions: + contents: read + +on: + push: + pull_request: + merge_group: + schedule: + - cron: '0 18 * * *' + +jobs: + build: + name: Build+test + runs-on: ${{ matrix.os }} + strategy: + matrix: + # test a bunch of toolchains on ubuntu + rust: + - stable + - beta + - nightly + os: [ubuntu-20.04] + # but only stable on macos/windows (slower platforms) + include: + - os: macos-latest + rust: stable + - os: windows-latest + rust: stable + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install ${{ matrix.rust }} toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + + - name: cargo build (debug; default features) + run: cargo build --locked + + - name: cargo test (debug; all features) + run: cargo test --locked --all-features + env: + RUST_BACKTRACE: 1 + + msrv: + name: MSRV + runs-on: ubuntu-20.04 + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "1.61" + + - run: cargo check --locked --lib --all-features -p rustls-mbedcrypto-provider + + features: + name: Features + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + + - name: cargo build (debug; default features) + run: cargo build --locked + + - name: cargo test (debug; default features) + run: cargo test --locked + env: + RUST_BACKTRACE: 1 + + - name: cargo test (debug; no default features) + run: cargo test --locked --no-default-features + + - name: cargo test (debug; no default features; tls12) + run: cargo test --locked --no-default-features --features tls12 + + - name: cargo test (debug; no default features; tls12, rdrand) + run: cargo test --locked --no-default-features --features tls12,rdrand + + - name: cargo test (release; no run) + run: cargo test --locked --release --no-run + + format: + name: Format + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Install rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt + - name: Check formatting + run: cargo fmt --all -- --check + + diff --git a/.gitignore b/.gitignore index 50baf8f..d26870e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,13 @@ .vscode/ target/ - +*.gcda +*.gcno +*.info +sslkeylogfile.txt +admin/rustfmt +.DS_Store +._.DS_Store +**/.DS_Store +**/._.DS_Store +/.idea +/default.profraw