-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): modernise and fix audit plus add file license check (#72)
- Loading branch information
Showing
15 changed files
with
244 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[TITLE]" | ||
labels: 'bug-report' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS & Version: [e.g. iOS 10.2.1] | ||
- Browser & Version [e.g. chrome v71.0.12345] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser & Version [e.g. stock browser v0.1.2] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Description | ||
--- | ||
|
||
Motivation and Context | ||
--- | ||
|
||
How Has This Been Tested? | ||
--- | ||
|
||
What process can a PR reviewer use to test or verify this change? | ||
--- | ||
|
||
<!-- Checklist --> | ||
<!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit | ||
tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> | ||
|
||
|
||
Breaking Changes | ||
--- | ||
|
||
- [x] None | ||
- [ ] Requires data directory on base node to be deleted | ||
- [ ] Requires hard fork | ||
- [ ] Other - Please specify | ||
|
||
<!-- Does this include a breaking change? If so, include this line as a footer --> | ||
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
--- | ||
name: Security audit | ||
name: Security audit - daily | ||
|
||
'on': | ||
push: | ||
pull_request: | ||
paths: | ||
# Run if workflow changes | ||
- '.github/workflows/audit.yml' | ||
# Run on changed dependencies | ||
- '**/Cargo.toml' | ||
- '**/Cargo.lock' | ||
# Run if the configuration file changes | ||
- '**/audit.toml' | ||
# Rerun periodicly to pick up new advisories | ||
schedule: | ||
- cron: "43 04 * * *" | ||
- cron: '43 05 * * *' | ||
# Run manually | ||
workflow_dispatch: | ||
|
||
env: | ||
toolchain: nightly-2022-11-03 | ||
|
||
jobs: | ||
security_audit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: "true" | ||
|
||
- name: toolchain | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
toolchain: ${{ env.toolchain }} | ||
components: rustfmt, clippy | ||
|
||
- name: cargo check | ||
run: | | ||
cargo check | ||
- uses: rustsec/audit-check@v1.4.1 | ||
- uses: rustsec/audit-check@v2.0.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
# Checks if the comments are signed or not | ||
name: PR - Signed commits check | ||
|
||
'on': | ||
pull_request_target | ||
|
||
concurrency: | ||
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix | ||
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | ||
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }} | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
check-signed-commits: | ||
name: Check signed commits in PR | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Check signed commits in PR | ||
uses: 1Password/check-signed-commits-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
fuzz/fuzz_targets/randomx_create_vm_with_cache_and_dataset.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
fuzz/fuzz_targets/randomx_vm_calculate_hash_with_cache_and_dataset.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
fuzz/fuzz_targets/randomx_vm_calculate_hash_with_cache_only.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Must be run from the repo root | ||
# | ||
|
||
set -e | ||
|
||
diffparms=${diffparms:-"-u --suppress-blank-empty --strip-trailing-cr --color=never"} | ||
rgTemp=${rgTemp:-$(mktemp)} | ||
|
||
# rg -i "Copyright.*The Tari Project" --files-without-match \ | ||
# -g '!*.{Dockerfile,asc,bat,config,config.js,css,csv,drawio,env,gitkeep,hbs,html,ini,iss,json,lock,md,min.js,ps1,py,rc,scss,sh,sql,svg,toml,txt,yml,vue}' . \ | ||
# | sort > /tmp/rgtemp | ||
|
||
# Exclude files without extensions as well as those with extensions that are not in the list | ||
# | ||
rg -i "Copyright.*The Tari Project" --files-without-match \ | ||
--one-file-system --no-follow \ | ||
-g '!{RandomX}' \ | ||
-g '!*.{Dockerfile,asc,bat,config,config.js,css,csv,drawio,env,gitkeep,hbs,html,ini,iss,json,lock,md,min.js,ps1,py,rc,scss,sh,sql,svg,toml,txt,yml,vue}' . \ | ||
| while IFS= read -r file; do | ||
if [[ -n $(basename "$file" | grep -E '\.') ]]; then | ||
echo "$file" | ||
fi | ||
done | sort > ${rgTemp} | ||
|
||
# Sort the .license.ignore file as sorting seems to behave differently on different platforms | ||
licenseIgnoreTemp=${licenseIgnoreTemp:-$(mktemp)} | ||
cat .license.ignore | sort > ${licenseIgnoreTemp} | ||
|
||
DIFFS=$( diff ${diffparms} ${licenseIgnoreTemp} ${rgTemp} || true ) | ||
|
||
# clean up | ||
rm -vf ${rgTemp} | ||
rm -vf ${licenseIgnoreTemp} | ||
|
||
if [ -n "${DIFFS}" ]; then | ||
echo "New files detected that either need copyright/license identifiers added, " | ||
echo "or they need to be added to .license.ignore" | ||
echo "NB: The ignore file must be sorted alphabetically!" | ||
|
||
echo "Diff:" | ||
echo "${DIFFS}" | ||
exit 1 | ||
fi |