forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add import linter check (openedx#31062)
* build: add import linter check
- Loading branch information
1 parent
2df1b60
commit 9c27944
Showing
6 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Lint Python Imports | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
|
||
lint-imports: | ||
name: Lint Python Imports | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Check out branch | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install system requirements | ||
run: sudo apt update && sudo apt install -y libxmlsec1-dev | ||
|
||
- name: Install pip | ||
run: python -m pip install -r requirements/pip.txt | ||
|
||
- name: Get pip cache dir | ||
id: pip-cache-dir | ||
run: echo "::set-output name=dir::$(pip cache dir)" | ||
|
||
- name: Cache pip dependencies | ||
id: cache-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.pip-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/development.txt') }} | ||
restore-keys: ${{ runner.os }}-pip- | ||
|
||
- name: Install python dependencies | ||
run: pip install -r requirements/edx/development.txt | ||
|
||
# As long there are sub-projects[1] in edx-platform, we analyze each | ||
# project separately here, in order to make import-linting errors easier | ||
# to pinpoint. | ||
# | ||
# [1] https://openedx.atlassian.net/browse/BOM-2579 | ||
|
||
- name: Analyze imports (repo root) | ||
run: make lint-imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters