Skip to content

Commit

Permalink
CI: add checks for Python and npm package licenses (mozilla#3383)
Browse files Browse the repository at this point in the history
  • Loading branch information
flodolo authored Sep 30, 2024
1 parent d931216 commit d54fccc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@ jobs:
-r requirements/dev.txt
-r requirements/test.txt
-r requirements/lint.txt
- name: Install pip-licenses
run: uv pip install 'pip-licenses==5.0.0'
- name: Check licenses
run: |
pip-licenses
pip-licenses --fail-on="GNU General Public License (GPL)" --ignore-packages text-unidecode translate-toolkit silme
# Set environment variables
- run: uv pip install pytest-dotenv
- run: >
sed
-e 's#^DATABASE_URL=.*#DATABASE_URL=postgres://pontoon:pontoon@localhost/pontoon#'
-e '/^SITE_URL=/d'
docker/config/server.env.template > .env
# Run collectstatic with minimal dependencies, skipping the actual front-end build
- run: npm install
working-directory: pontoon
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ jobs:
run: npm run build
working-directory: translate

licenses:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: '18' }
- name: Install globals
run: npm install --global [email protected]
- name: Install dependencies
run: npm ci
- name: Check licenses
run: |
# --failOn doesn't print the licenses on failure.
# Use jq to print only minimal info, then print a summary when
# checking for GPL packages.
license-checker-rseidelsohn --json | jq -r 'to_entries[] | "\(.key): \(.value.licenses)"'
license-checker-rseidelsohn --summary --failOn 'GPL'
jest:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit d54fccc

Please sign in to comment.