diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index a017ad0..19037ee 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -10,7 +10,38 @@ permissions: id-token: write jobs: - + download-history: + runs-on: ubuntu-latest + name: Download history + steps: + - run: > + ARTIFACT_ID=$(curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" "https://api.github.com/repos/Train-lab-intern/aqa_python/actions/artifacts?name=reports" | python3 -c "import sys, json; print(json.load(sys.stdin)['artifacts'][0]['id']);") + && + curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.TOKEN }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/Train-lab-intern/aqa_python/actions/artifacts/$ARTIFACT_ID/zip -o artifacts.zip + && + REPORT_ID=$(curl -L + -H "Accept: application/vnd.github+json" + -H "X-GitHub-Api-Version: 2022-11-28" + "https://api.github.com/repos/Train-lab-intern/aqa_python/actions/artifacts?name=github-pages" + | python -c "import sys, json; print(json.load(sys.stdin)['artifacts'][0]['id']);") + && + curl -L + -H "Accept: application/vnd.github+json" + -H "Authorization: Bearer ${{ secrets.TOKEN }}" + -H "X-GitHub-Api-Version: 2022-11-28" + https://api.github.com/repos/Train-lab-intern/aqa_python/actions/artifacts/$REPORT_ID/zip + -o pages.zip + - run: cat artifacts.zip + - run: mkdir reports && unzip artifacts.zip -d reports + - run: mkdir old_pages pages_history && unzip pages.zip -d old_pages && tar -xvf old_pages/artifact.tar -C pages_history + - run: cp pages_history/history/* reports && cp -r pages_history/history reports + - name: Store allure history + uses: actions/upload-artifact@v4 + with: + name: reports + path: + reports + retention-days: 5