Rafatoração #43
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: Robot Framework - API Tests | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
jobs: | |
api-tests: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
name: API Tests 🤖🤖 | |
steps: | |
- name: Checkout 🚀🚀 | |
uses: actions/checkout@v4 | |
- name: Setup Python 🔧🔧 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies ➕➕ | |
run: pip install -r requirements.txt | |
- name: API Tests 🧪🧪 | |
run: robot -d ./reports -v EMAIL:${{ secrets.EMAIL }} -v PASSWORD:${{ secrets.PASSWORD }} tests | |
- name: Publish Robot Reports 📄📄 | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Robot-Reports | |
path: reports | |
retention-days: 90 | |
if-no-files-found: warn | |
- name: Slack Notification - Success | |
if: ${{ success() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: pipeline-notifications | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/1642/1642322.png | |
SLACK_TITLE: 'All tests passed successfully' | |
SLACK_MESSAGE: ':robot: Tests passed :robot:' | |
SLACK_USERNAME: SUCCESS | |
- name: Slack Notification - Failure | |
if: ${{ failure() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_CHANNEL: pipeline-notifications | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_ICON: https://cdn-icons-png.flaticon.com/512/3271/3271351.png | |
SLACK_TITLE: 'Some tests failed' | |
SLACK_MESSAGE: ':fire: Tests failed :fire:' | |
SLACK_USERNAME: FAILURE | |
reports: | |
if: always() | |
needs: [api-tests] | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
name: Reports 📄📄 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Robot Reports | |
uses: actions/download-artifact@v4 | |
with: | |
name: Robot-Reports | |
path: reports | |
- name: Send report to commit | |
uses: joonvena/robotframework-reporter-action@v2.4 | |
with: | |
gh_access_token: ${{ secrets.GITHUB_TOKEN }} |