Skip to content

Commit

Permalink
Update run_tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
SiarheiZhachek authored Jul 24, 2024
1 parent b4429f0 commit 38e69b7
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,54 @@ permissions:

jobs:


test:
download-history:
# if: false
runs-on: ubuntu-latest
name: Download history
steps:
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: >
ARTIFACT_ID=$(curl -L
-H "Accept: application/vnd.github+json"
-H "X-GitHub-Api-Version: 2022-11-28"
"https://api.github.com/repos/SiarheiZhachek/QA_diploma/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/SiarheiZhachek/QA_diploma/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/SiarheiZhachek/QA_diploma/actions/artifacts?name=github-pages"
| 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/SiarheiZhachek/QA_diploma/actions/artifacts/$REPORT_ID/zip
-o pages.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@v3
with:
name: reports
path:
reports
retention-days: 2

test:
runs-on: ubuntu-latest
needs: download-history


steps:
Expand Down Expand Up @@ -54,7 +99,7 @@ jobs:
name: _site
path:
_site
retention-days: 1
retention-days: 2

publish-report:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 38e69b7

Please sign in to comment.