From 4aa2a4eb477b64f8ce3cd3f709aaeeefa95c9623 Mon Sep 17 00:00:00 2001 From: Roman Donchenko Date: Mon, 2 Sep 2024 18:06:04 +0300 Subject: [PATCH] Switch to v4 of artifact actions (#8342) v3 is due to stop working on 2024-11-30: . Note that `artifact-upload@v4` no longer allows multiple jobs of the same workflow to upload an artifact with the same name, thus I had to rename several of the artifacts. In the case of coverage results, re-merge them at the end to avoid clutter on the workflow summary page. I didn't bother with merging other artifacts, because they're only produced in case of failure, so I'm not expecting them to create much clutter. Delete the schema upload step entirely, because I don't think it works (it's inside the wrong job), and it doesn't seem that useful anyway. --- .github/workflows/full.yml | 35 ++++++++------------ .github/workflows/helm.yml | 2 +- .github/workflows/main.yml | 60 +++++++++++++++++----------------- .github/workflows/schedule.yml | 10 +++--- 4 files changed, 50 insertions(+), 57 deletions(-) diff --git a/.github/workflows/full.yml b/.github/workflows/full.yml index 4042828ccfb..5de1edf6feb 100644 --- a/.github/workflows/full.yml +++ b/.github/workflows/full.yml @@ -75,19 +75,19 @@ jobs: cp -r cvat-sdk/* /tmp/cvat_sdk/ - name: Upload CVAT server artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/image.tar - name: Upload CVAT UI artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/image.tar - name: Upload CVAT SDK artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_sdk path: /tmp/cvat_sdk/ @@ -105,19 +105,19 @@ jobs: python-version: '3.8' - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ - name: Download CVAT UI images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/ - name: Download CVAT SDK package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_sdk path: /tmp/cvat_sdk/ @@ -150,13 +150,6 @@ jobs: docker run --rm cvat/server:${CVAT_VERSION} bash \ -c 'python manage.py makemigrations --check' - - name: Upload expected schema as an artifact - if: failure() && steps.verify_schema.conclusion == 'failure' - uses: actions/upload-artifact@v3.1.2 - with: - name: expected_schema - path: cvat/schema-expected.yml - - name: Generate SDK run: | pip3 install -r cvat-sdk/gen/requirements.txt @@ -186,7 +179,7 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() && steps.run_tests.conclusion == 'failure' - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: rest_api_container_logs path: "${{ github.workspace }}/rest_api_testing" @@ -200,7 +193,7 @@ jobs: ref: ${{ inputs.ref }} - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ @@ -245,7 +238,7 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: unit_tests_container_logs path: "${{ github.workspace }}/unit_testing" @@ -270,13 +263,13 @@ jobs: node-version: '16.x' - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ - name: Download CVAT UI image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/ @@ -345,14 +338,14 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: e2e_container_logs + name: e2e_container_logs_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cvat_${{ matrix.specs }}.log - name: Uploading cypress screenshots as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: cypress_screenshots_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/screenshots diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index f43317deed1..ac7c8c3dce8 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -103,7 +103,7 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: rest_api_container_logs path: "${{ github.workspace }}/rest_api_testing" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 822934ee9ba..04900c9c69e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,19 +113,19 @@ jobs: -c 'python manage.py makemigrations --check' - name: Upload CVAT server artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/image.tar - name: Upload CVAT UI artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/image.tar - name: Upload CVAT SDK artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: cvat_sdk path: /tmp/cvat_sdk/ @@ -141,13 +141,13 @@ jobs: python-version: '3.8' - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ - name: Download CVAT UI images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/ @@ -160,13 +160,6 @@ jobs: docker tag cvat/ui:latest cvat/ui:${CVAT_VERSION} docker image ls -a - - name: Upload expected schema as an artifact - if: failure() && steps.verify_schema.conclusion == 'failure' - uses: actions/upload-artifact@v3.1.2 - with: - name: expected_schema - path: cvat/schema-expected.yml - - name: Generate SDK run: | pip3 install -r cvat-sdk/gen/requirements.txt @@ -188,9 +181,9 @@ jobs: ONE_RUNNING_JOB_IN_QUEUE_PER_USER="true" pytest tests/python/rest_api/test_queues.py --cov --cov-report=json - name: Uploading code coverage results as an artifact - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: coverage_results + name: coverage_results_rest_api path: | coverage*.json @@ -207,7 +200,7 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() && steps.run_tests.conclusion == 'failure' - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: rest_api_container_logs path: "${{ github.workspace }}/rest_api_testing" @@ -219,7 +212,7 @@ jobs: - uses: actions/checkout@v4 - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ @@ -254,9 +247,9 @@ jobs: -c 'DISABLE_HUSKY=1 yarn --frozen-lockfile && yarn workspace cvat-core run test && mv cvat-core/reports/coverage/coverage-final.json ${CONTAINER_COVERAGE_DATA_DIR}' - name: Uploading code coverage results as an artifact - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: coverage_results + name: coverage_results_unit_tests path: | ${{ github.workspace }}/coverage-final.json ${{ github.workspace }}/unit_tests_coverage.json @@ -272,7 +265,7 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: unit_tests_container_logs path: "${{ github.workspace }}/unit_testing" @@ -295,13 +288,13 @@ jobs: node-version: '18.x' - name: Download CVAT server image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ - name: Download CVAT UI image - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/ @@ -363,9 +356,9 @@ jobs: mv coverage/coverage-final.json coverage/${{ matrix.specs }}_coverage.json - name: Uploading code coverage results as an artifact - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: coverage_results + name: coverage_results_e2e_${{ matrix.specs }} path: | tests/coverage/${{ matrix.specs }}_coverage.json @@ -378,21 +371,21 @@ jobs: - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: e2e_container_logs + name: e2e_container_logs_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cvat_${{ matrix.specs }}.log - name: Uploading cypress screenshots as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: cypress_screenshots_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/screenshots - name: Uploading cypress videos as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: cypress_videos_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/videos @@ -405,13 +398,13 @@ jobs: - uses: actions/checkout@v4 - name: Download CVAT server images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_server path: /tmp/cvat_server/ - name: Download CVAT UI images - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: cvat_ui path: /tmp/cvat_ui/ @@ -444,8 +437,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Merge coverage artifacts + uses: actions/upload-artifact/merge@v4 + with: + name: coverage_results + pattern: coverage_results_* + delete-merged: true + - name: Downloading coverage results - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: coverage_results diff --git a/.github/workflows/schedule.yml b/.github/workflows/schedule.yml index 7fd9e6f6304..7fc63bf8dca 100644 --- a/.github/workflows/schedule.yml +++ b/.github/workflows/schedule.yml @@ -308,21 +308,21 @@ jobs: - name: Uploading cypress screenshots as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: cypress_screenshots + name: cypress_screenshots_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/screenshots - name: Uploading cypress videos as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: name: cypress_videos_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cypress/videos - name: Uploading "cvat" container logs as an artifact if: failure() - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4 with: - name: cvat_container_logs + name: cvat_container_logs_${{ matrix.specs }} path: ${{ github.workspace }}/tests/cvat.log