Skip to content

CI/CD

CI/CD #56

Workflow file for this run

name: CI/CD
on:
schedule:
- cron: '00 05 * * *'
jobs:
load-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run local k6 test
uses: grafana/[email protected]
with:
filename: ./script.js
- name: Store performance test results
uses: actions/upload-artifact@v3
with:
name: k6-summary-report
path: summary.html
send_email:
needs: load-testing
runs-on: ubuntu-latest
steps:
- name: Checkout do código-fonte
uses: actions/checkout@v2
- name: Exibir conteúdo da pasta
run: ls -la
- name: Baixar o artefato
uses: actions/download-artifact@v2
with:
name: k6-summary-report
path: .
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Instação dependencias package
run: npm install
working-directory: ./email-sender
- name: Copiar o artefato para a pasta de envio de e-mail
run: cp summary.html ./email-sender
- name: Exibir conteúdo da pasta email-sender
run: ls -la email-sender/
- name: Enviando o email com o report
env:
EMAIL_USER: ${{ secrets.EMAIL_USER }}
KEY_GENERATE: ${{ secrets.KEY_GENERATE }}
RECIPIENT: ${{ secrets.RECIPIENT }}
ARTIFACT_PATH: ./email-sender/summary.html
run: |
node ./email-sender/send-email.js ${{ env.ARTIFACT_PATH }}