diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 857d0bddc..26734610a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,3 +50,29 @@ jobs: - run: cargo install --locked --version "~0.17" cargo-audit - run: cargo audit --ignore RUSTSEC-2020-0159 --ignore RUSTSEC-2020-0071 + license: + name: Check dependencies for licenses + runs-on: ubuntu-latest + outputs: + license_changed: ${{ steps.license_diff.outputs.license_changed }} + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo install --locked --version "~0.5" cargo-about + - run: cargo about generate --workspace --output-file "${{ runner.temp }}/licenses.html" about.hbs + - id: license_diff + run: | + if diff -q THIRD_PARTY_LICENSES_RUST_CRATES.html ${{ runner.temp }}/licenses.html ; then + echo "license_changed=NO" >> $GITHUB_OUTPUT + else + echo "license_changed=YES" >> $GITHUB_OUTPUT + fi + + license_update: + name: Check if rust crates license files needs updates + runs-on: ubuntu-latest + needs: license + continue-on-error: true + steps: + - run: test "${{ needs.license.outputs.license_changed }}" == "NO"