Skip to content

Commit 6a7afa3

Browse files
committed
Added CI and badges
1 parent b7cd0ab commit 6a7afa3

File tree

7 files changed

+81
-0
lines changed

7 files changed

+81
-0
lines changed

.github/workflows/rust.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
windows:
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- run: ci/set_rust_version.bash ${{ matrix.channel }} ${{ matrix.target }}
11+
shell: bash
12+
- run: ci/build.bash cargo ${{ matrix.target }}
13+
shell: bash
14+
- run: ci/test.bash cargo ${{ matrix.target }}
15+
shell: bash
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
channel: [stable]
21+
target:
22+
- x86_64-pc-windows-msvc
23+
- x86_64-pc-windows-gnu

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ publish = false
1313

1414
[package.metadata.docs.rs]
1515
targets = ["x86_64-pc-windows-gnu", "x86_64-pc-windows-msvc"]
16+
no-default-features = true
17+
features = ["ring"]
1618

1719
[dependencies]
1820
rustls = { git = "https://github.com/rustls/rustls.git", default-features = false, features = [

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Windows CNG bridge for rustls
22

3+
[![github actions](https://github.com/ancwrd1/rustls-cng/workflows/CI/badge.svg)](https://github.com/rustls/rustls-cng/actions)
4+
[![crates](https://img.shields.io/crates/v/rustls-cng.svg)](https://crates.io/crates/rustls-cng)
5+
[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6+
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
7+
[![docs.rs](https://docs.rs/rustls-cng/badge.svg)](https://docs.rs/rustls-cng)
8+
39
This crate allows you to use the Windows CNG private keys together with [rustls](https://docs.rs/rustls/latest/rustls)
410
for both the client and server sides of the TLS channel.
511

ci/build.bash

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
# Script for building your rust projects.
3+
set -e
4+
5+
source ci/common.bash
6+
7+
# $1 {path} = Path to cross/cargo executable
8+
CROSS=$1
9+
# $2 {string} = <Target Triple>
10+
TARGET_TRIPLE=$2
11+
# $3 {boolean} = Whether or not building for release or not.
12+
RELEASE_BUILD=$3
13+
14+
required_arg $CROSS 'CROSS'
15+
required_arg $TARGET_TRIPLE '<Target Triple>'
16+
17+
if [ -z "$RELEASE_BUILD" ]; then
18+
$CROSS build --target $TARGET_TRIPLE --workspace
19+
$CROSS build --target $TARGET_TRIPLE --all-features --workspace
20+
else
21+
$CROSS build --target $TARGET_TRIPLE --all-features --release --workspace
22+
fi
23+

ci/common.bash

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
required_arg() {
2+
if [ -z "$1" ]; then
3+
echo "Required argument $2 missing"
4+
exit 1
5+
fi
6+
}

ci/set_rust_version.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
rustup update
4+
rustup default $1
5+
rustup target add $2

ci/test.bash

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
# Script for building your rust projects.
3+
set -e
4+
5+
source ci/common.bash
6+
7+
# $1 {path} = Path to cross/cargo executable
8+
CROSS=$1
9+
# $2 {string} = <Target Triple>
10+
TARGET_TRIPLE=$2
11+
12+
required_arg $CROSS 'CROSS'
13+
required_arg $TARGET_TRIPLE '<Target Triple>'
14+
15+
$CROSS test --target $TARGET_TRIPLE --workspace
16+
$CROSS build --target $TARGET_TRIPLE --all-features --workspace

0 commit comments

Comments
 (0)