CI #4281
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: CI | |
on: [deployment_status] | |
jobs: | |
# trigger a test | |
Cypress: | |
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Run Cypress | |
uses: cypress-io/github-action@v2 | |
env: | |
CYPRESS_BASE_URL: ${{ github.event.deployment_status.target_url }} | |
- name: Cypress tests ✅ | |
if: ${{ success() }} | |
run: | | |
curl --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data '{ | |
"context": "Cypress ✅", | |
"state": "success", | |
"description": "Cypress tests passed", | |
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
}' | |
- name: Cypress tests 🚨 | |
if: ${{ failure() }} | |
run: | | |
curl --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \ | |
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ | |
--header 'content-type: application/json' \ | |
--data '{ | |
"context": "Cypress 🚨", | |
"state": "failure", | |
"description": "Cypress tests failed" | |
}' |