Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add checks for Python and npm package licenses #3383

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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