-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into JF/fix_certificate_palm
- Loading branch information
Showing
312 changed files
with
5,745 additions
and
4,399 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
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,72 @@ | ||
name: Recompile Python dependencies | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Target branch to create requirements PR against' | ||
required: true | ||
default: 'master' | ||
type: string | ||
|
||
defaults: | ||
run: | ||
shell: bash # making this explicit opts into -e -o pipefail | ||
|
||
jobs: | ||
recompile-python-dependencies: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Check out target branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "${{ inputs.branch }}" | ||
|
||
- name: Set up Python environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Run make compile-requirements | ||
env: | ||
PACKAGE: "${{ inputs.package }}" | ||
run: | | ||
make compile-requirements | ||
- name: PR preflight | ||
run: | | ||
if git diff --exit-code; then | ||
# Fail early (and avoid quiet failure of create-pull-request action) | ||
echo "Error: No changes, so not creating PR." | tee -a "$GITHUB_STEP_SUMMARY" | ||
exit 1 | ||
fi | ||
- name: Make a PR | ||
id: make-pr | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
branch: "${{ github.triggering_actor }}/compile-python-deps" | ||
branch-suffix: short-commit-hash | ||
add-paths: requirements | ||
commit-message: | | ||
feat: Recompile Python dependencies | ||
Commit generated by workflow `${{ github.workflow_ref }}` | ||
title: "chore: Recompile Python dependencies" | ||
body: >- | ||
PR generated by workflow `${{ github.workflow_ref }}` | ||
on behalf of @${{ github.triggering_actor }}. | ||
assignees: "${{ github.triggering_actor }}" | ||
reviewers: "${{ github.triggering_actor }}" | ||
|
||
- name: Job summary | ||
env: | ||
PR_URL: "${{ steps.make-pr.outputs.pull-request-url }}" | ||
run: | | ||
if [[ -z "$PR_URL" ]]; then | ||
echo "PR not created; see log for more information" | tee -a "$GITHUB_STEP_SUMMARY" | ||
exit 1 | ||
else | ||
echo "PR created or updated: $PR_URL" | tee -a "$GITHUB_STEP_SUMMARY" | ||
fi |
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 |
---|---|---|
|
@@ -15,8 +15,17 @@ jobs: | |
matrix: | ||
os: [ ubuntu-20.04 ] | ||
python-version: [ 3.8 ] | ||
# 'pinned' is used to install the latest patch version of Django | ||
# within the global constraint i.e. Django==3.2.21 in current case | ||
# because we have global constraint of Django<4.2 | ||
django-version: ["pinned", "4.2"] | ||
mongo-version: ["4"] | ||
mysql-version: ["5.7", "8"] | ||
# excluding mysql5.7 with Django 4.2 since Django 4.2 has | ||
# dropped support for MySQL<8 | ||
exclude: | ||
- django-version: "4.2" | ||
mysql-version: "5.7" | ||
services: | ||
mongo: | ||
image: mongo:${{ matrix.mongo-version }} | ||
|
@@ -92,6 +101,14 @@ jobs: | |
- name: Install Python dependencies | ||
run: | | ||
make dev-requirements | ||
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then | ||
pip install "django~=${{ matrix.django-version }}.0" | ||
pip check # fail if this test-reqs/Django combination is broken | ||
fi | ||
- name: list installed package versions | ||
run: | | ||
sudo pip freeze | ||
- name: Run Tests | ||
env: | ||
|
@@ -103,3 +120,19 @@ jobs: | |
./manage.py lms migrate | ||
echo "Running the CMS migrations." | ||
./manage.py cms migrate | ||
# This job aggregates test results. It's the required check for branch protection. | ||
# https://github.com/marketplace/actions/alls-green#why | ||
# https://github.com/orgs/community/discussions/33579 | ||
success: | ||
name: Migrations checks successful | ||
if: always() | ||
needs: | ||
- check_migrations | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Decide whether the needed jobs succeeded or failed | ||
# uses: re-actors/[email protected] | ||
uses: re-actors/alls-green@13b4244b312e8a314951e03958a2f91519a6a3c9 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Finds code problems by structural pattern matching. | ||
# | ||
# New rules can be added to test_root/semgrep/ and they should be picked up | ||
# automatically. See https://semgrep.dev/docs/ for documentation. | ||
|
||
name: Semgrep code quality | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
run_semgrep: | ||
name: Semgrep analysis | ||
runs-on: "${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
os: [ "ubuntu-20.04" ] | ||
python-version: [ "3.8" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
|
||
- name: Install semgrep | ||
run: | | ||
make pre-requirements | ||
pip-sync requirements/edx/semgrep.txt | ||
- name: Run semgrep | ||
env: | ||
# Peg this to some reasonable value so that semgrep's rewrapping | ||
# of messages doesn't break up lines in an unpredictable manner: | ||
# https://github.com/returntocorp/semgrep/issues/8608 | ||
COLUMNS: 80 | ||
run: | | ||
semgrep scan --config test_root/semgrep/ --error --quiet \ | ||
-- lms cms common openedx |
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
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
Oops, something went wrong.