Skip to content

Commit

Permalink
tools: add doc diff
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Feb 18, 2022
1 parent f84c3d3 commit 27fae1b
Show file tree
Hide file tree
Showing 9 changed files with 18,082 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/config/cargo-deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ignore = [
multiple-versions = "deny"

skip-tree = [
{ name = "docdiff" }, # docdiff is a private crate
{ name = "duvet" }, # duvet is a private crate
{ name = "criterion" }, # criterion is always going to be just a test dependency
{ name = "s2n-quic-integration" }, # s2n-quic-integration is a private crate
Expand All @@ -27,7 +28,9 @@ unknown-git = "deny"
unlicensed = "deny"
allow-osi-fsf-free = "neither"
copyleft = "deny"
confidence-threshold = 0.90
confidence-threshold = 0.9
# ignore licenses for private crates
private = { ignore = true }
allow = [
"Apache-2.0",
"BSD-2-Clause",
Expand Down
62 changes: 60 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,48 @@ jobs:
status: "success"
url: "${{ steps.s3.outputs.URL }}"

docdiff:
runs-on: ubuntu-latest
needs: env
steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: actions-rs/[email protected]
id: toolchain
with:
# pin to a specific version so we don't get breakage in the generated html
toolchain: ${{ needs.env.outputs.msrv }}
profile: minimal
override: true

- uses: camshaft/rust-cache@v1

- name: Clean up cache
run: |
rm -f target/release/docdiff
rm -f common/docdiff/target/release/docdiff
- name: Cache docdiff
uses: actions/[email protected]
continue-on-error: true
with:
path: target/release/docdiff
key: ${{ runner.os }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('common/docdiff/**') }}

- name: Build docdiff
working-directory: common/docdiff
run: |
if [ ! -f ../../target/release/docdiff ]; then
mkdir -p ../../target/release
cargo build --release
cp target/release/docdiff ../../target/release/docdiff
fi
- name: Run docdiff
run: ./target/release/docdiff s2n-quic

test:
runs-on: ${{ matrix.os }}
needs: env
Expand Down Expand Up @@ -276,7 +318,9 @@ jobs:
- uses: camshaft/rust-cache@v1

- name: Clean up cache
run: rm -f target/release/duvet
run: |
rm -f target/release/duvet
rm -f common/duvet/target/release/duvet
- name: Cache duvet
uses: actions/[email protected]
Expand All @@ -286,7 +330,13 @@ jobs:
key: ${{ runner.os }}-${{ steps.toolchain.outputs.rustc_hash }}-${{ github.job }}-duvet-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('common/duvet/**') }}

- name: Build duvet
run: test -f target/release/duvet || cargo build --bin duvet --release
working-directory: common/duvet
run: |
if [ ! -f ../../target/release/duvet ]; then
mkdir -p ../../target/release
cargo build --release
cp target/release/duvet ../../target/release/duvet
fi
- name: Run duvet
run: ./scripts/compliance ${{ github.sha }}
Expand Down Expand Up @@ -498,6 +548,14 @@ jobs:

- uses: camshaft/rust-cache@v1

- name: Remove api snapshots
run: |
rm quic/*/api.snap
git config --global user.email "[email protected]"
git config --global user.name "CI"
git add .
git commit -m 'remove api.snap'
- name: Run cargo insta test
run: |
cargo insta test --delete-unreferenced-snapshots
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[workspace]
members = [
"common/duvet",
"common/s2n-*",
"quic/s2n-*",
]
Expand Down
21 changes: 21 additions & 0 deletions common/docdiff/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "docdiff"
version = "0.1.0"
authors = ["AWS s2n"]
edition = "2018"
license = "Apache-2.0"
publish = false

[dependencies]
anyhow = "1"
duct = "0.13"
glob = "0.3"
insta = "1"
once_cell = "1"
rayon = "1"
scraper = "0.12"
selectors = "0.22"
structopt = "0.3"

[workspace]
members = ["."]
Loading

0 comments on commit 27fae1b

Please sign in to comment.