From 4eb4bbbb0321f947b5a78a3d77abfc5bbe435249 Mon Sep 17 00:00:00 2001 From: Ron Kuris Date: Tue, 26 Sep 2023 14:02:59 -0700 Subject: [PATCH] Add a license check for each file to CI (#263) --- .github/check-license-headers.yaml | 38 ++++++++++++++++++++++++++++++ .github/license-header.txt | 2 ++ .github/workflows/ci.yaml | 6 +++++ 3 files changed, 46 insertions(+) create mode 100644 .github/check-license-headers.yaml create mode 100644 .github/license-header.txt diff --git a/.github/check-license-headers.yaml b/.github/check-license-headers.yaml new file mode 100644 index 000000000..9837b1026 --- /dev/null +++ b/.github/check-license-headers.yaml @@ -0,0 +1,38 @@ +[ + { + "include": [ + "**/**/*.rs" + ], + "exclude": [ + "target/**", + "*/LICENSE*", + "LICENSE.md", + "RELEASE.md", + "rpc/**", + "README*", + "*/README*", + "Cargo.toml", + "*/Cargo.toml", + "libaio/**", + "docs/**", + "CODEOWNERS" + ], + "license": "./.github/license-header.txt" + }, + { + "include": [ + "target/**", + "*/LICENSE*", + "LICENSE.md", + "RELEASE.md", + "rpc/**", + "README*", + "*/README*", + "Cargo.toml", + "*/Cargo.toml", + "libaio/**", + "docs/**", + "CODEOWNERS" + ], + } +] diff --git a/.github/license-header.txt b/.github/license-header.txt new file mode 100644 index 000000000..bb72d440a --- /dev/null +++ b/.github/license-header.txt @@ -0,0 +1,2 @@ +// Copyright (C) %year%, Ava Labs, Inc. All rights reserved. +// See the file LICENSE.md for licensing terms. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e18c5371d..e26b9094d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,6 +80,12 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - uses: arduino/setup-protoc@v2 + - name: Check license headers + uses: viperproject/check-license-header@v2 + with: + path: . + config: .github/check-license-headers.yaml + strict: true - name: Restore Check Deps id: cache-build-deps-restore uses: actions/cache/restore@v3