Skip to content
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
4 changes: 3 additions & 1 deletion .github/workflows/cli-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,67 @@
jobs:

run_ci:
runs-on: ${{ matrix.os.image }}
# Linux is pinned because Ubuntu 26.04 (ubuntu-latest) removed apt-key; see LP-1474.
# matrix.os.image stays ubuntu-latest so required check names don't change.
runs-on: ${{ matrix.os.name == 'linux' && 'ubuntu-24.04' || matrix.os.image }}
env:
DEVSTACK_WORKSPACE: /tmp
SHALLOW_CLONE: 1
# Don't report metrics as real usage
DEVSTACK_METRICS_TESTING: ci
strategy:
matrix:
os:
- name: linux
image: ubuntu-latest
- name: mac
# Pin to GitHub's Intel macOS runner because this Docker/Colima job
# fails on arm64 macOS runners, including macos-latest.
image: macos-26-intel
python-version:
- '3.11'
fail-fast: false

steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Docker installation - Linux
if: ${{ matrix.os.name == 'linux' }}
run: |
docker version
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal test"
sudo apt update
sudo apt install docker-ce containerd.io
docker version
docker compose --version

# Note: we cannot use Docker Desktop because it has not been licensed for use in GithubActions
- name: Docker installation - Mac
if: ${{ matrix.os.name == 'mac' }}
run: |
brew install colima docker docker-compose
colima start -a vz -m 8 -r docker
echo "DOCKER_HOST=unix://${HOME}/.colima/docker.sock" >> $GITHUB_ENV
mkdir -p ~/.docker/cli-plugins
ln -sfn /usr/local/bin/docker-compose ~/.docker/cli-plugins/docker-compose

- name: Install Python dependencies
run: make requirements

# proactively download and extract the image to avoid test timeouts in tests/metrics.py
# this should be moved into a test setup
- name: Pull redis docker image
run: make dev.pull.redis

- name: CLI tests
run: pytest -s ./tests/*.py

- name: Repo setup-remotes tests
run: ./tests/test_repo.sh

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
4 changes: 3 additions & 1 deletion .github/workflows/provisioning-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,97 +19,99 @@
jobs:

run_ci:
runs-on: ${{ matrix.os }}
# Pinned because Ubuntu 26.04 (ubuntu-latest) removed apt-key; see LP-1474.
# matrix.os stays ubuntu-latest so required check names don't change.
runs-on: ubuntu-24.04
env:
DEVSTACK_WORKSPACE: /tmp
SHALLOW_CLONE: 1
# Don't report metrics as real usage
DEVSTACK_METRICS_TESTING: ci
strategy:
matrix:
os:
- ubuntu-latest
python-version: [ '3.11' ]
services: [ discovery+lms+forum ,registrar+lms, ecommerce+lms, edx_notes_api+lms, credentials+lms, xqueue, analyticsapi+insights+lms, designer+lms, enterprise-subsidy+enterprise-catalog+enterprise-access+lms, license-manager+lms, edx-exams+lms]
fail-fast: false # some services can be flaky; let others run to completion even if one fails

steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: installations and version upgrades
run: |
docker version
sudo apt-get update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal test"
sudo apt update
sudo apt install docker-ce containerd.io
docker version
docker compose --version

- name: free up disk space
# 2023-09-28: google-cloud-sdk removed from this list because it was intermittently
# unavailable as an apt package to remove, and might be migrating to snap. If more
# disk space is needed, see if the snap is installed, and remove that.
run: sudo apt remove --purge -y ghc-* azure-cli llvm-* dotnet-* powershell mono-* php* ruby*

- name: set up requirements
run: make requirements

- name: clone repositories
run: make dev.clone.https

- name: pull images and print
run: |
make dev.pull.${{matrix.services}}
docker images --digests | grep latest | sort

- name: provision
run: make dev.provision.${{matrix.services}}

- name: "Bring up services"
# Use the without-wait variant: this job only provisions a subset of
# services, so their un-provisioned transitive dependencies can never
# become healthy.
run: make dev.up.without-wait.${{matrix.services}}

- name: "Wait for services to become ready"
run: |
# Wait a reasonable amount of time for services to come up. If they
# don't, then call the checks one more time to ensure that diagnostic
# information is printed out. (It's suppressed by wait-for.)
timeout 5m make dev.wait-for.${{matrix.services}} || timeout 1m make dev.check.${{matrix.services}}

- name: notify on failure
if: ${{ failure() && github.ref == 'refs/heads/master' }}
uses: dawidd6/action-send-mail@v3
with:
server_address: email-smtp.us-east-1.amazonaws.com
server_port: 465
username: ${{secrets.EDX_SMTP_USERNAME}}
password: ${{secrets.EDX_SMTP_PASSWORD}}
subject: 'Failure: Devstack provisioning tests for ${{matrix.services}} #${{github.run_id}}'
to: devstack-provisioning-tests@2u-internal.jsmalerts.atlassian.net
from: github-actions <github-actions@edx.org>
body: |
Devstack provisioning tests in ${{github.repository}} for ${{matrix.services}} failed!
For details, see https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
Runbook url: https://2u-internal.atlassian.net/wiki/spaces/AT/pages/16384920/Failure+Devstack+provisioning+tests+-+Runbook

- name: close alerts on success
if: ${{ !failure() && github.ref == 'refs/heads/master' }}
uses: dawidd6/action-send-mail@v3
with:
server_address: email-smtp.us-east-1.amazonaws.com
server_port: 465
username: ${{secrets.EDX_SMTP_USERNAME}}
password: ${{secrets.EDX_SMTP_PASSWORD}}
subject: 'Back to normal: Devstack provisioning tests for ${{matrix.services}} #${{github.run_id}}'
to: devstack-provisioning-tests@2u-internal.jsmalerts.atlassian.net
from: github-actions <github-actions@edx.org>
body: Devstack provisioning tests in ${{github.repository}} are back to normal for ${{matrix.services}}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading