updated fileupload test with allure and updated actions workflow #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Selenium Tests | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| permissions: | |
| contents: write # Needed to push to gh-pages | |
| pages: write | |
| id-token: write | |
| jobs: | |
| test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout code | |
| - name: 📥 Checkout code | |
| uses: actions/checkout@v5 | |
| # Set Up JDK 21 | |
| - name: ☕ Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '21.0.5' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| # Build with Maven, skipping tests | |
| - name: 🔨 Build with Maven | |
| run: mvn clean install -DskipTests | |
| # get allure history | |
| - name: 📚 Download Allure report history | |
| uses: actions/checkout@v5 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| # Run Selenium tests | |
| - name: 🧪 run Selenium smoke tests | |
| id: tests | |
| run: mvn clean test -Denv=prod -Dgroups=smoke | |
| continue-on-error: true | |
| # Generate Allure Report | |
| - name: 📊 Build Allure Report | |
| uses: simple-elf/allure-report-action@v1.13 | |
| if: always() | |
| with: | |
| gh_pages: gh-pages | |
| allure_history: allure-history | |
| allure_results: target/allure-results | |
| keep_reports: true | |
| # Publish test reports | |
| - name: 🚀 Publish test report | |
| uses: peaceiris/actions-gh-pages@v3 | |
| if: always() | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: gh-pages | |
| publish_dir: allure-history | |
| # Add report to summary | |
| - name: 📝 Add report link to summary | |
| if: always() | |
| run: | | |
| echo "## Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "📊 [View Allure Report](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/)" >> $GITHUB_STEP_SUMMARY | |
| if [ "${{ steps.tests.outcome }}" == "success" ]; then | |
| echo "✅ All tests passed!" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "❌ Some tests failed. Check the report for details." >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # Fail the workflow if tests failed | |
| - name: 💥 Check test results | |
| if: steps.tests.outcome == 'failure' | |
| run: | | |
| echo "❌ Tests failed!" | |
| exit 1 |