From ce56f341c7cd3e7f48418d0fdbffcd4d93df1645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 5 Feb 2026 16:00:26 -0300 Subject: [PATCH 1/2] ci: add GHA and license linters --- .github/workflows/pr_lint_gha.yaml | 29 ++++++++++++++++ .github/workflows/pr_lint_license.yaml | 47 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/pr_lint_gha.yaml create mode 100644 .github/workflows/pr_lint_license.yaml diff --git a/.github/workflows/pr_lint_gha.yaml b/.github/workflows/pr_lint_gha.yaml new file mode 100644 index 0000000..0c0ec0c --- /dev/null +++ b/.github/workflows/pr_lint_gha.yaml @@ -0,0 +1,29 @@ +name: GitHub Actions + +on: + workflow_dispatch: + pull_request: + branches: ["**"] + paths: + - ".github/**.yaml" + - ".github/**.yml" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Install actionlint + run: bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + + - name: Run actionlint + run: ./actionlint diff --git a/.github/workflows/pr_lint_license.yaml b/.github/workflows/pr_lint_license.yaml new file mode 100644 index 0000000..51cd60d --- /dev/null +++ b/.github/workflows/pr_lint_license.yaml @@ -0,0 +1,47 @@ +name: Check License + +on: + workflow_dispatch: + pull_request: + branches: ["**"] + paths: + - "**/Cargo.toml" + - "LICENSE*" + - ".github/workflows/pr_lint_license.yaml" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + check-license: + name: Verify License + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check LICENSE file exists + run: | + if [ ! -f LICENSE ]; then + echo "::error::LICENSE file is missing" + exit 1 + fi + echo "License file present" + + - name: Check all packages reference LICENSE + run: | + MISSING=$(cargo metadata --format-version 1 --no-deps 2>/dev/null | \ + jq -r '.packages[] | select(.license != "LICENSE") | .name') + + if [ -n "$MISSING" ]; then + echo "::error::The following packages do not reference 'LICENSE':" + echo "$MISSING" + echo "" + echo "Ensure each Cargo.toml has: license = \"LICENSE\"" + exit 1 + fi + + echo "All packages correctly reference LICENSE file" From eeb8f6e73eac376288b96d397bb4463e5c1e8316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gr=C3=BCner?= <47506558+MegaRedHand@users.noreply.github.com> Date: Thu, 5 Feb 2026 16:45:16 -0300 Subject: [PATCH 2/2] ci: fix GHA and license linters --- .github/workflows/pr_lint_gha.yaml | 2 +- bin/ethlambda/Cargo.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_lint_gha.yaml b/.github/workflows/pr_lint_gha.yaml index 0c0ec0c..5d12ec8 100644 --- a/.github/workflows/pr_lint_gha.yaml +++ b/.github/workflows/pr_lint_gha.yaml @@ -26,4 +26,4 @@ jobs: run: bash <(curl -s https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) - name: Run actionlint - run: ./actionlint + run: ./actionlint -ignore SC2086 diff --git a/bin/ethlambda/Cargo.toml b/bin/ethlambda/Cargo.toml index ef20137..16eb517 100644 --- a/bin/ethlambda/Cargo.toml +++ b/bin/ethlambda/Cargo.toml @@ -3,6 +3,7 @@ name = "ethlambda" version.workspace = true edition.workspace = true authors.workspace = true +license.workspace = true [dependencies] ethlambda-blockchain.workspace = true