Adicionando github-pages no arquivo yml de workflow #24
This file contains 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: Pipeline Testes Automatizados Web Front ERP Qa.Coders Academy Robot Framework | |
# executa o workflow toda vez que for realizado um push ou pull-request no repositório | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# permite também executar esse workflow manualmente na aba "Actions" do GitHub | |
workflow_dispatch: | |
jobs: | |
robot-web-chrome: | |
# agente de execução/runner | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: https://andressakarla.github.io/blacklist-academy12.2-front-robot/log.html | |
steps: | |
- name: Passo 1 - Obter cópia do código-fonte do repositório | |
uses: actions/checkout@v3 | |
- name: Passo 2 - Redirecionar os conteúdos de "secrets.USUARIO_ENV", para os fixtures "usuario.json", etc | |
run: | | |
echo '${{ secrets.USUARIO_ENV }}' > ./resources/fixtures/usuario.json | |
- name: Passo 3 - Instalar python versão 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Passo 4 - Instalar dependências do projeto | |
run: | | |
pip install -r requirements.txt | |
- name: Passo 5 - Executar testes automatizados Web no navegador chrome em modo headless (2º plano) no ambiente de automação e Gerar reports html, xml e screenshots | |
run: robot -d ./reports -v BROWSER:headlesschrome ./tests/* | |
- name: Passo 6 - Armazenar reports html, xml e screenshots | |
# expressão condicional para que sempre seja executado independentemente dos resultados dos steps anteriores | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: robot-web-reports-html-xml-screenshots-chrome | |
path: ./reports | |
# armazena por 30 dias | |
retention-days: 30 | |
- name: Passo 7 - Configurar pages | |
if: ${{ always() }} | |
uses: actions/configure-pages@v2 | |
- name: Passo 8 - Baixar report html armazenado no "Passo 6 - Armazenar reports html, xml e screenshots" | |
if: ${{ always() }} | |
uses: actions/download-artifact@v3 | |
with: | |
name: robot-web-reports-html-xml-screenshots-chrome | |
path: ./reports | |
- name: Passo 9 - Armazenar pages | |
if: ${{ always() }} | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ./reports | |
retention-days: 30 | |
- name: Passo 10 - Deploy/Publicar no Github Pages na "url" configurada em "robot-web-chrome > environment" | |
if: ${{ always() }} | |
id: deployment | |
uses: actions/deploy-pages@v1 |