Skip to content

Merge pull request #61 from ladesa-ro/dependabot/github_actions/dot-g… #229

Merge pull request #61 from ladesa-ro/dependabot/github_actions/dot-g…

Merge pull request #61 from ladesa-ro/dependabot/github_actions/dot-g… #229

name: NUnit Tests and Deploy Allure Reports
on:
push:
branches:
- development
paths:
- "**/*"
- .github/workflows/test-and-deploy.yml
pull_request:
branches:
- development
paths:
- "**/*"
- .github/workflows/test-and-deploy.yml
workflow_dispatch:
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Test
run: dotnet test
continue-on-error: true
- name: Upload Allure Results
uses: actions/upload-artifact@v4.4.0
with:
name: allure-results
path: GerarHorario-Tests/bin/Debug/net8.0/allure-results
if-no-files-found: error
retention-days: 20
report:
needs: test
runs-on: ubuntu-latest
steps:
- name: Download Build Artifact
uses: actions/download-artifact@v4.1.8
with:
name: allure-results
path: ./allure-results
- name: Get Allure history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Generate report
uses: simple-elf/allure-report-action@v1.9
if: always()
id: allure-report
with:
gh_pages: allure-report/b/development
allure_history: allure-history
allure_results: allure-results
keep_reports: 20
- name: Deploy report to Github Pages
uses: peaceiris/actions-gh-pages@v4.0.0
if: always()
with:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-report
destination_dir: ${{
github.ref == 'refs/heads/development' && 'b/development' || (
github.ref == 'refs/heads/main' && 'b/main' || format('r/{0}', github.run_number)
) }}