Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license check #165

Merged
merged 2 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,28 @@ jobs:
if: ${{ matrix.check == 'clippy' }}
run: cargo clippy -- -D warnings

license-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install cargo-about
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-about
version: "0.5"

- name: Run license check
# Explicitly use stable because otherwise cargo will trigger a download of
# the nightly version specified in rust-toolchain.toml
run: cargo +stable about generate about.hbs > license.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good catch!


- name: Archive license file
uses: actions/upload-artifact@v3
with:
name: license
path: license.html

cargo-toml-fmt:
runs-on: ubuntu-latest
container: "tamasfe/taplo:0.7.0-alpine"
Expand Down
70 changes: 70 additions & 0 deletions about.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<html>

<head>
<style>
@media (prefers-color-scheme: dark) {
body {
background: #333;
color: white;
}
a {
color: skyblue;
}
}
.container {
font-family: sans-serif;
max-width: 800px;
margin: 0 auto;
}
.intro {
text-align: center;
}
.licenses-list {
list-style-type: none;
margin: 0;
padding: 0;
}
.license-used-by {
margin-top: -10px;
}
.license-text {
max-height: 200px;
overflow-y: scroll;
white-space: pre-wrap;
}
</style>
</head>

<body>
<main class="container">
<div class="intro">
<h1>Third Party Licenses</h1>
<p>This page lists the licenses of the projects used in 'Integritee Networks Parachain' repository. </p>
</div>

<h2>Overview of licenses:</h2>
<ul class="licenses-overview">
{{#each overview}}
<li><a href="#{{id}}">{{name}}</a> ({{count}})</li>
{{/each}}
</ul>

<h2>All license text:</h2>
<ul class="licenses-list">
{{#each licenses}}
<li class="license">
<h3 id="{{id}}">{{name}}</h3>
<h4>Used by:</h4>
<ul class="license-used-by">
{{#each used_by}}
<li><a href="{{#if crate.repository}} {{crate.repository}} {{else}} https://crates.io/crates/{{crate.name}} {{/if}}">{{crate.name}} {{crate.version}}</a></li>
{{/each}}
</ul>
<pre class="license-text">{{text}}</pre>
</li>
{{/each}}
</ul>
</main>
</body>

</html>
20 changes: 20 additions & 0 deletions about.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
accepted = [
"Apache-2.0",
"MIT",
"Apache-2.0 WITH LLVM-exception",
"BSD-2-Clause",
"CC0-1.0",
"BSD-3-Clause",
"MPL-2.0",
"ISC",
"OpenSSL",
"Unicode-DFS-2016",
"Zlib",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"GPL-3.0 WITH Classpath-exception-2.0",
"GPL-3.0",
]
ignore-dev-dependencies = true
ignore-build-dependencies = true
workarounds = [
"ring",
]