diff --git a/.github/workflows/_license.yml b/.github/workflows/_license.yml new file mode 100644 index 0000000000..500658567b --- /dev/null +++ b/.github/workflows/_license.yml @@ -0,0 +1,30 @@ +on: + workflow_call: + +jobs: + artifacts: + runs-on: ubuntu-latest + + steps: + - name: Dependencies license compliance checker + id: license_check_report + uses: pilosus/action-pip-license-checker@cc7a461bfa27b44ad187b8578c881ef5138c13fd + with: + external: "licenses.csv" + external-format: "csv" + external-options: "{:skip-header false :package-column-index 0 :license-column-index 2}" + report-format: "json-pretty" + formatter: "%-65s %-65s %-20s %-40s" + totals: true + headers: true + fail: "StrongCopyleft,NetworkCopyleft,Other,Error" + verbose: 1 + - name: Save report + if: ${{ always() }} + run: echo "${{ steps.license_check_report.outputs.report }}" > license-report.json + - name: Upload artifact + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: license-report + path: license-report.json diff --git a/.github/workflows/_release.yml b/.github/workflows/_release.yml index 1332bd2de6..10d8ed87d1 100644 --- a/.github/workflows/_release.yml +++ b/.github/workflows/_release.yml @@ -11,29 +11,6 @@ jobs: with: merge-multiple: true - - name: Dependencies license compliance checker - id: license_check_report - uses: pilosus/action-pip-license-checker@cc7a461bfa27b44ad187b8578c881ef5138c13fd - with: - external: "licenses.csv" - external-format: "csv" - external-options: "{:skip-header false :package-column-index 0 :license-column-index 2}" - report-format: "json-pretty" - formatter: "%-65s %-65s %-20s %-40s" - totals: true - headers: true - fail: "StrongCopyleft,NetworkCopyleft,Other,Error" - verbose: 1 - - name: Save report - if: ${{ always() }} - run: echo "${{ steps.license_check_report.outputs.report }}" > license-report.json - - name: Upload artifact - if: ${{ always() }} - uses: actions/upload-artifact@v3 - with: - name: license-report - path: license-report.json - - name: Zip up docs run: | set -vxeuo pipefail diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e591089f..b9468a4001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,11 @@ jobs: with: tox: pre-commit,type-checking + license_check: + needs: check + if: needs.check.outputs.branch-pr == '' + uses: ./.github/workflows/_license.yml + test: needs: check if: needs.check.outputs.branch-pr == ''