diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51bb5a1..1ba45c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,56 +2,41 @@ name: Python CI on: push: - branches: - - master + branches: [ master ] pull_request: branches: - '**' + workflow_dispatch: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true jobs: - run_tests: - name: Tests + tests: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-20.04] python-version: [3.8] - toxenv: [ quality, unit, integration ] - steps: - - name: Checkout Repo - uses: actions/checkout@v2 + toxenv: [django32, django42, quality, package] - - name: Install Required System Packages - if: matrix.toxenv == 'integration' - run: sudo apt-get update && sudo apt-get install libxmlsec1-dev ubuntu-restricted-extras xvfb - - - name: Use Gecko Driver - if: matrix.toxenv == 'integration' - uses: browser-actions/setup-geckodriver@latest + steps: + - name: checkout repo + uses: actions/checkout@v3 + with: + submodules: recursive - name: setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install -U pip wheel - pip install tox pylint + - name: Install Dependencies + run: make requirements - - name: Run Quality - env: - TOXENV: ${{ matrix.toxenv }} - if: matrix.toxenv == 'quality' - run: | - tox -e quality - - name: Run Unit Tests - env: - TOXENV: ${{ matrix.toxenv }} - if: matrix.toxenv == 'unit' - run: tox -e unit - - name: Run Integration Tests + - name: Run Tests env: TOXENV: ${{ matrix.toxenv }} - if: matrix.toxenv == 'integration' - run: xvfb-run --auto-servernum tox -e integration + run: tox diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 0000000..527dc58 --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,30 @@ +name: Publish package to PyPI + +on: + release: + types: [published] + +jobs: + push: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install Dependencies + run: pip install -r requirements/pip.txt + + - name: Build package + run: python setup.py sdist bdist_wheel + + - name: Publish to PyPi + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_UPLOAD_TOKEN }} diff --git a/.github/workflows/upgrade-python-requirements.yml b/.github/workflows/upgrade-python-requirements.yml new file mode 100644 index 0000000..dc92eef --- /dev/null +++ b/.github/workflows/upgrade-python-requirements.yml @@ -0,0 +1,29 @@ +name: Upgrade Python Requirements + +on: + schedule: + - cron: "0 0 * * 1" + workflow_dispatch: + inputs: + branch: + description: Target branch against which to create requirements PR + required: true + default: master + +jobs: + call-upgrade-python-requirements-workflow: + uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master + # Do not run on forks + if: github.repository_owner == 'openedx' + with: + branch: ${{ github.event.inputs.branch || 'master' }} + # optional parameters below; fill in if you'd like github or email notifications + # user_reviewers: "" + # team_reviewers: "" + # email_address: "" + # send_success_notification: false + secrets: + requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }} + requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }} + edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }} + edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}