diff --git a/.github/workflows/migrations-check.yml b/.github/workflows/migrations-check.yml index fb66cfe775cb..68023a6f4b09 100644 --- a/.github/workflows/migrations-check.yml +++ b/.github/workflows/migrations-check.yml @@ -19,7 +19,7 @@ jobs: # within the global constraint i.e. Django==4.2.8 in current case # because we have global constraint of Django<4.2 django-version: ["pinned"] - mongo-version: ["4"] + mongo-version: ["4", "7"] mysql-version: ["8"] services: mongo: @@ -27,9 +27,9 @@ jobs: ports: - 27017:27017 # Note: Calling mongo here only works with mongo 4, in newer versions of mongo - # we'll have to use `mongosh` + # we'll have to use `mongosh`, hence the 'which mongosh mongo'. options: >- - --health-cmd "mongo --quiet --eval 'db.runCommand(\"ping\")'" + --health-cmd "$(which mongosh mongo) --quiet --eval 'db.runCommand(\"ping\")'" --health-interval 10s --health-timeout 5s --health-retries 3 diff --git a/.github/workflows/static-assets-check.yml b/.github/workflows/static-assets-check.yml index 37c70a5c1362..5aedfdf52f73 100644 --- a/.github/workflows/static-assets-check.yml +++ b/.github/workflows/static-assets-check.yml @@ -16,6 +16,20 @@ jobs: python-version: [ 3.8 ] node-version: [ 16 ] npm-version: [ 8.5.x ] + mongo-version: ["4.4", "7.0"] + + services: + mongo: + image: mongo:${{ matrix.mongo-version }} + ports: + - 27017:27017 + # Note: Calling mongo here only works with mongo 4, in newer versions of mongo + # we'll have to use `mongosh`, hence the 'which mongosh mongo'. + options: >- + --health-cmd "$(which mongosh mongo) --quiet --eval 'db.runCommand(\"ping\")'" + --health-interval 10s + --health-timeout 5s + --health-retries 3 steps: - name: Checkout repo diff --git a/.github/workflows/unit-tests-gh-hosted.yml b/.github/workflows/unit-tests-gh-hosted.yml index 60dabbbecec8..b9681db67f46 100644 --- a/.github/workflows/unit-tests-gh-hosted.yml +++ b/.github/workflows/unit-tests-gh-hosted.yml @@ -36,7 +36,10 @@ jobs: - "common-with-cms" - "xmodule-with-lms" - "xmodule-with-cms" - name: gh-hosted-python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} + mongo-version: + - "4.4" + - "7.0" + name: gh-hosted-python-${{ matrix.python-version }},django-${{ matrix.django-version }},mongo-${{ matrix.mongo-version }}${{ matrix.shard_name }} steps: - uses: actions/checkout@v2 @@ -46,7 +49,7 @@ jobs: - name: Start MongoDB uses: supercharge/mongodb-github-action@1.7.0 with: - mongodb-version: 4.4 + mongodb-version: ${{ matrix.mongo-version}} - name: Setup Python uses: actions/setup-python@v4 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index be7e122f2fd8..d08dc1aadc81 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ on: jobs: run-tests: - name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }} + name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},mongo-${{ matrix.mongo-version }},${{ matrix.shard_name }} if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) runs-on: [ edx-platform-runner ] strategy: @@ -36,6 +36,9 @@ jobs: - "common-with-cms" - "xmodule-with-lms" - "xmodule-with-cms" + mongo-version: + - "4.4" + - "7.0" # We expect Django 4.0 to fail, so don't stop when it fails. continue-on-error: ${{ matrix.django-version == '4.0' }} @@ -43,6 +46,16 @@ jobs: - name: sync directory owner run: sudo chown runner:runner -R .* + - name: install mongo version + run: | + if [[ "${{ matrix.mongo-version }}" != "4.4" ]]; then + sudo apt-get purge -y "mongodb-org*" + sudo apt-get remove -y mongodb-org + wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongo-version }}.asc | sudo apt-key add - + echo "deb https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongo-version }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongo-version }}.list + sudo apt-get update && sudo apt-get install -y mongodb-org="${{ matrix.mongo-version }}.*" + fi + - name: checkout repo uses: actions/checkout@v3