diff --git a/.github/workflows/migrations-mysql8-check.yml b/.github/workflows/migrations-mysql8-check.yml index c18ff27e1..0c81d3f57 100644 --- a/.github/workflows/migrations-mysql8-check.yml +++ b/.github/workflows/migrations-mysql8-check.yml @@ -14,6 +14,25 @@ jobs: strategy: matrix: python-version: ["3.12"] + mysql-version: ["8"] + services: + mysql: + image: mysql:${{ matrix.mysql-version }} + ports: + - 3306:3306 + env: + MYSQL_DATABASE: "edxapp" + MYSQL_USER: "edxapp001" + MYSQL_PASSWORD: "password" + MYSQL_RANDOM_ROOT_PASSWORD: true + # Ping over TCP, not the socket. On first start the image creates the + # database and user using a temporary server with networking turned off, + # so a socket ping can report healthy before MySQL accepts connections. + options: >- + --health-cmd "mysqladmin ping -h 127.0.0.1" + --health-interval 5s + --health-timeout 5s + --health-retries 20 steps: - name: Checkout repo @@ -24,10 +43,14 @@ jobs: with: python-version: ${{ matrix.python-version }} + # mysqlclient is built from source below and needs the client headers. + # --no-upgrade leaves the image's own MySQL packages alone: upgrading the + # client pulls in a mysql-server upgrade whose post-install script fails + # on ubuntu-26.04 runners. - name: Install system Packages run: | sudo apt-get update - sudo apt-get install -y libxmlsec1-dev + sudo apt-get install -y --no-upgrade libxmlsec1-dev libmysqlclient-dev mysql-client pkg-config - name: Get pip cache dir id: pip-cache-dir run: | @@ -40,10 +63,6 @@ jobs: key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pip_tools.txt') }} restore-keys: ${{ runner.os }}-pip- - - name: Ubuntu and sql Versions - run: | - lsb_release -a - mysql -V - name: Install Python dependencies run: | pip install -r requirements/pip_tools.txt @@ -53,25 +72,17 @@ jobs: pip uninstall -y xmlsec pip install --no-binary xmlsec xmlsec xmlsec==1.3.13 - - name: Initiate Services - run: | - sudo /etc/init.d/mysql start - - name: Reset mysql password + - name: Verify mysql db credentials run: | - cat <