From 1eb2e9b990b5a86ed35cb762dbf6bed25705cbb9 Mon Sep 17 00:00:00 2001 From: Oleg Kulachenko Date: Sat, 3 Jun 2023 20:29:56 +0400 Subject: [PATCH] workflow: Add a deploying Allure reports to NeoFS #2324 https://github.com/nspcc-dev/neofs-testcases/issues/574 Added a workflow for deploy Allure tests result as static web page to NeoFS. This new functionality will help to save any test report as an object in the NeoFS network, we will become independent of the limitations of the GitHub branches and pages. It will also be an "advertisement" for our object storage. Signed-off-by: Oleg Kulachenko --- .github/workflows/run-tests.yml | 79 +++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 705248e4686..4ce82a08500 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,12 +27,26 @@ jobs: run_system_tests: runs-on: ubuntu-latest timeout-minutes: 500 + env: + TEST_RESULTS_PASSWORD: ${{ secrets.TEST_RESULTS_PASSWORD }} + TEST_RESULTS_WALLET: ${{ secrets.TEST_RESULTS_WALLET }} + TEST_RESULTS_NEOFS_NETWORK_DOMAIN: "t5.fs.neo.org" + TEST_RESULTS_CID: "86C4P6uJC7gb5n3KkwEGpXRfdczubXyRNW5N9KeJRW73" steps: + - name: Get the current date + id: date + run: echo "::set-output name=timestamp::$(date +%s)" + + - name: Set RUN_ID + env: + TIMESTAMP: ${{ steps.date.outputs.timestamp }} + run: echo "RUN_ID=${{ github.run_number }}-$TIMESTAMP" >> $GITHUB_ENV + - name: Checkout neofs-testcases repository uses: actions/checkout@v3 with: repository: vvarg229/neofs-testcases - ref: 'tst-skip' + ref: 'neofs-allure' path: neofs-testcases - name: Checkout neofs-dev-env repository @@ -47,7 +61,21 @@ jobs: with: path: neofs-node -################################################################ + - name: Download latest stable neofs-cli for uploading reports to NeoFS + uses: dsaltares/fetch-gh-release-asset@1.1.1 + with: + repo: 'nspcc-dev/neofs-node' + version: 'tags/v0.37.0' + file: 'neofs-cli-amd64' + target: 'neofs-node-stable/neofs-cli' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Chmod latest stable neofs-cli + run: | + sudo chmod a+x neofs-cli + working-directory: neofs-node-stable + +################################################################# - name: Set up Go uses: actions/setup-go@v4 with: @@ -217,36 +245,41 @@ jobs: working-directory: neofs-testcases ################################################################ - - name: Get Allure history - timeout-minutes: 60 - uses: actions/checkout@v3 - if: always() - with: - ref: gh-pages - path: gh-pages - - - name: Allure Report action from marketplace + - name: Generate Allure report timeout-minutes: 60 uses: simple-elf/allure-report-action@v1.6 if: always() id: allure-report with: - keep_reports: 200 + keep_reports: 100000 allure_results: allure-results allure_report: allure-report - gh_pages: gh-pages allure_history: allure-history - - name: Deploy report to Github Pages - timeout-minutes: 120 + - name: Remove testing neofs-cli if: always() - uses: peaceiris/actions-gh-pages@v3.9.3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_branch: gh-pages - publish_dir: allure-history - force_orphan: true - enable_jekyll: true + run: | + make clean + working-directory: neofs-node + + - name: Enable stable neofs-cli + if: always() + run: | + echo "$(pwd)" >> $GITHUB_PATH + working-directory: neofs-node-stable + + - name: Create wallet + if: always() + run: | + echo "$TEST_RESULTS_WALLET" | base64 -d > wallet.json + working-directory: neofs-testcases + + - name: Put allure report to NeoFS + if: always() + run: | + sudo chmod -R a+rw ${GITHUB_WORKSPACE}/allure-report + source venv.local-pytest/bin/activate && python ./tools/src/process-allure-reports.py --neofs_domain $TEST_RESULTS_NEOFS_NETWORK_DOMAIN --run_id $RUN_ID --cid $TEST_RESULTS_CID --allure_report ${GITHUB_WORKSPACE}/allure-report --wallet wallet.json + working-directory: neofs-testcases - name: Post the link to the report timeout-minutes: 60 @@ -257,4 +290,4 @@ jobs: context: 'Test report' state: 'success' sha: ${{github.event.pull_request.head.sha || github.sha}} - target_url: https://${{ github.repository_owner }}.github.io/neofs-node/${{ github.run_number }} + target_url: https://http.${{ env.TEST_RESULTS_NEOFS_NETWORK_DOMAIN }}/${{ env.TEST_RESULTS_CID }}/${{ env.RUN_ID }}/index.html