|
| 1 | +name: Jupiter Automated Tests |
| 2 | + |
| 3 | +on: [ push ] |
| 4 | +#on: |
| 5 | +# push: |
| 6 | +# branches: |
| 7 | +# - main |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pages: write |
| 12 | + id-token: write |
| 13 | + statuses: write |
| 14 | + |
| 15 | +jobs: |
| 16 | + test: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + name: Run JUPITER Automated Tests |
| 19 | + steps: |
| 20 | + - name: Checkout Repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + - name: Set up JDK 21 |
| 23 | + uses: actions/setup-java@v4 |
| 24 | + with: |
| 25 | + distribution: 'temurin' |
| 26 | + java-version: '21' |
| 27 | + - name: Check Java version |
| 28 | + run: java -version |
| 29 | + - name: Run Automates Tests |
| 30 | + run: ./mvnw clean test |
| 31 | + continue-on-error: true |
| 32 | + - name: Check Allure Results Directory |
| 33 | + run: | |
| 34 | + pwd |
| 35 | + echo "All files in the current directory: " |
| 36 | + ls -la |
| 37 | + echo "Allure results folder: " |
| 38 | + ls -la target/allure-results |
| 39 | + - name: Store Allure Results |
| 40 | + uses: actions/upload-artifact@v4 |
| 41 | + with: |
| 42 | + name: allure-results |
| 43 | + path: target/allure-results |
| 44 | + retention-days: 1 |
| 45 | + |
| 46 | + generate-report: |
| 47 | + needs: test |
| 48 | + runs-on: ubuntu-latest |
| 49 | + name: Generate Allure Report |
| 50 | + steps: |
| 51 | + - name: Download Allure Results |
| 52 | + uses: actions/download-artifact@v4 |
| 53 | + with: |
| 54 | + name: allure-results |
| 55 | + path: ./allure-results |
| 56 | + |
| 57 | + - name: Check Allure Results Directory |
| 58 | + run: | |
| 59 | + pwd |
| 60 | + echo "All files in the current directory: " |
| 61 | + ls -la |
| 62 | + echo "Allure results folder: " |
| 63 | + ls -la ./allure-results |
| 64 | +
|
| 65 | + - name: Get Allure History |
| 66 | + uses: actions/checkout@v4 |
| 67 | + if: always() |
| 68 | + continue-on-error: true |
| 69 | + with: |
| 70 | + ref: gh-pages |
| 71 | + path: gh-pages |
| 72 | + fetch-depth: 0 |
| 73 | + |
| 74 | + - name: Generate Allure Report |
| 75 | + uses: simple-elf/allure-report-action@master |
| 76 | + if: always() |
| 77 | + id: allure-report |
| 78 | + with: |
| 79 | + allure_results: allure-results |
| 80 | + gh_pages: gh-pages |
| 81 | + allure_report: allure-report |
| 82 | + allure_history: allure-history |
| 83 | + keep_reports: 20 |
| 84 | + |
| 85 | + - name: Deploy Report to Github Pages |
| 86 | + if: always() |
| 87 | + uses: peaceiris/actions-gh-pages@v4 |
| 88 | + with: |
| 89 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + publish_branch: gh-pages |
| 91 | + publish_dir: allure-history |
0 commit comments