diff --git a/.github/actions/unit-tests/action.yml b/.github/actions/unit-tests/action.yml index 2a5429baff09..eb7fee0a6ba6 100644 --- a/.github/actions/unit-tests/action.yml +++ b/.github/actions/unit-tests/action.yml @@ -27,8 +27,9 @@ runs: - name: save pytest warnings json file if: success() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pytest-warnings-json path: | test_root/log/pytest_warnings*.json + overwrite: true diff --git a/.github/workflows/js-tests.yml b/.github/workflows/js-tests.yml index 8b7c137c8b23..ed91bdc4bc5f 100644 --- a/.github/workflows/js-tests.yml +++ b/.github/workflows/js-tests.yml @@ -74,7 +74,7 @@ jobs: xvfb-run --auto-servernum ./scripts/all-tests.sh - name: Save Job Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Build-Artifacts path: | @@ -82,3 +82,4 @@ jobs: test_root/log/*.png test_root/log/*.log **/TEST-*.xml + overwrite: true diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index 6bf16c9f0b2f..5e5cb5b67a9f 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -73,10 +73,11 @@ jobs: - name: Save Job Artifacts if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Build-Artifacts path: | **/reports/**/* test_root/log/**/*.log *.log + overwrite: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b65e0bcd0b85..aa8356a6fee6 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -10,7 +10,7 @@ jobs: run-tests: name: ${{ matrix.shard_name }}(py=${{ matrix.python-version }},dj=${{ matrix.django-version }},mongo=${{ matrix.mongo-version }}) if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) - runs-on: [ edx-platform-runner ] + runs-on: ubuntu-20.04 strategy: matrix: python-version: @@ -62,8 +62,6 @@ jobs: - 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 }}.*" @@ -83,8 +81,15 @@ jobs: - name: checkout repo uses: actions/checkout@v3 + - name: Setup Python Virtual Environment + run: | + python3 -m venv .venv + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + - name: install requirements run: | + . .venv/bin/activate sudo make test-requirements if [[ "${{ matrix.django-version }}" != "pinned" ]]; then sudo pip install "django~=${{ matrix.django-version }}.0" @@ -103,10 +108,11 @@ jobs: mv reports/.coverage reports/${{ matrix.shard_name }}.coverage - name: Upload coverage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage path: reports/${{matrix.shard_name}}.coverage + overwrite: true # This job aggregates test results. It's the required check for branch protection. # https://github.com/marketplace/actions/alls-green#why @@ -125,14 +131,14 @@ jobs: jobs: ${{ toJSON(needs) }} compile-warnings-report: - runs-on: [ edx-platform-runner ] + runs-on: ubuntu-20.04 needs: [ run-tests ] steps: - name: sync directory owner run: sudo chown runner:runner -R .* - uses: actions/checkout@v3 - name: collect pytest warnings files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: pytest-warnings-json path: test_root/log @@ -146,11 +152,12 @@ jobs: - name: save warning report if: success() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: pytest-warning-report-html path: | reports/pytest_warnings/warning_report_all.html + overwrite: true # Combine and upload coverage reports. coverage: @@ -170,7 +177,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Download all artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: coverage path: reports diff --git a/.github/workflows/verify-gha-unit-tests-count.yml b/.github/workflows/verify-gha-unit-tests-count.yml index 1f6f91829c89..3d0ef2968d04 100644 --- a/.github/workflows/verify-gha-unit-tests-count.yml +++ b/.github/workflows/verify-gha-unit-tests-count.yml @@ -9,7 +9,7 @@ on: jobs: collect-and-verify: if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false)) - runs-on: [ edx-platform-runner ] + runs-on: ubuntu-20.04 steps: - name: sync directory owner run: sudo chown runner:runner -R .* @@ -19,9 +19,16 @@ jobs: with: python-version: '3.11' + - name: Setup Python Virtual Environment + run: | + python3 -m venv .venv + . .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + - uses: actions/checkout@v2 - name: install requirements run: | + . .venv/bin/activate sudo make test-requirements - name: verify unit tests count