Skip to content

Commit

Permalink
fix: update upload & download artifact actions
Browse files Browse the repository at this point in the history
  • Loading branch information
irtazaakram committed May 21, 2024
1 parent e95d7e7 commit 8ca5b03
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/actions/unit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ 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: |
reports/**/*
test_root/log/*.png
test_root/log/*.log
**/TEST-*.xml
overwrite: true
3 changes: 2 additions & 1 deletion .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 15 additions & 8 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}.*"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/verify-gha-unit-tests-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .*
Expand All @@ -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
Expand Down

0 comments on commit 8ca5b03

Please sign in to comment.