diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 8e056b96..41dfbb12 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -18,7 +18,7 @@ jobs: curl -fsSL https://pixi.sh/install.sh | bash export PATH="$HOME/.pixi/bin:$PATH" pixi install - + - name: Install Java for Allure run: | sudo apt update -y @@ -36,26 +36,22 @@ jobs: - name: Run tests and generate reports run: | export PATH="$HOME/.pixi/bin:$PATH" - mkdir -p ../ci-reports + mkdir -p ci-reports pixi run pytest tests \ --cov=slic \ --cov-report=xml \ --cov-report=html \ - --html=../ci-reports/html-report.html \ - --self-contained-html \ - --alluredir=allure-results - allure generate allure-results -o ../ci-reports/allure-report + --alluredir=allure-results \ + --html=ci-reports/html-report.html \ + --self-contained-html + allure generate allure-results -o ci-reports/allure-report - - - name: Copy reports to ci-reports/ + - name: Copy coverage reports to ci-reports/ run: | mkdir -p ci-reports/coverage cp -r htmlcov/* ci-reports/coverage/ cp coverage.xml ci-reports/coverage/ - mkdir -p ci-reports/allure - cp -r allure-report/* ci-reports/allure/ - - name: Commit and push CI reports run: | git config user.name "ci-bot" @@ -66,41 +62,7 @@ jobs: env: CI_TOKEN: ${{ secrets.CI_TOKEN }} - - name: Deploy Allure report to allure-report branch - run: | - git config user.name "ci-bot" - git config user.email "ci-bot@example.com" - - # Copie les fichiers dans un dossier temporaire - cp -r ci-reports/allure /tmp/allure-report - - # Crée une branche orpheline propre - git fetch origin - git checkout --orphan allure-report - git rm -rf . || true - - # Copie les fichiers HTML - cp -r /tmp/allure-report/* . - git add . - git commit -m "Deploy Allure report" - git push --force https://ci-token:${{ secrets.CI_TOKEN }}@gitea.psi.ch/tligui_y/slic.git HEAD:allure-report - env: - CI_TOKEN: ${{ secrets.CI_TOKEN }} - - - name: Commit and push pytest-html report - run: | - git config user.name "ci-bot" - git config user.email "ci-bot@example.com" - git add ci-reports/* - git commit -m "Add HTML test report [skip ci]" || echo "Nothing to commit" - git push https://ci-token:${{ secrets.CI_TOKEN }}@gitea.psi.ch/tligui_y/slic.git HEAD:utils_testing - env: - CI_TOKEN: ${{ secrets.CI_TOKEN }} - - - name: Cleanup Pixi cache run: | rm -rf ~/.cache/rattler rm -rf ~/.pixi - -