Md 2172 #3342
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: (M) Behat Tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
database: | |
description: 'Recent database dump to use (leave blank to use artifact)' | |
sites: | |
description: 'Specify which sites to test or leave the default to run all tests.' | |
default: 'cci, champ, coco, usrse, careers, gpc, ky, nect' | |
required: true | |
prnum: | |
description: 'Pull request number — adds a comment to a pull request (nomally empty)' | |
permissions: | |
contents: write | |
actions: read | |
pull-requests: write | |
jobs: | |
cci: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'cci') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "cci" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
asp: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'asp') | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "asp" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
champ: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'champ') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "champ" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
coco: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'coco') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "coco" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
usrse: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'usrse') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "usrse" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
careers: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'careers') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "careers" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
gpc: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'gpc') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "gpc" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
ky: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'ky') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "ky" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
nect: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'nect') || github.event_name == 'pull_request' | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "nect" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
wip: | |
uses: necyberteam/reusable_actions/.github/workflows/behat.yml@v3 | |
if: contains(github.event.inputs.sites, 'wip') | |
secrets: | |
slack_token: ${{ secrets.SLACK_TOKEN }} | |
site: "wip" | |
database: ${{ github.event.inputs.database }} | |
prnum: ${{ github.event.inputs.prnum }} | |
gh_token: ${{ secrets.GH_TOKEN_REPO }} | |
LANDO_ENV: ${{ secrets.LANDO_ENV }} | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
# success: | |
# name: Actions to run on success | |
# needs: [cci, asp, champ, coco, usrse, careers, gpc, ky, nect, wip] | |
# if: ${{ success() || ( always() && ! cancelled() && ! failure() ) }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Comment on pull request | |
# if: "${{ env.prnum != '' }}" | |
# run: | | |
# gh pr comment $prnum -R $REPO --body "🤖 -=-=-=- Behat Test was Successful -=-=-=- 🤖" | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# prnum: ${{ github.event.inputs.prnum }} | |
# REPO: "${{ github.server_url }}/${{ github.repository }}" | |
# - name: Slack Notification Success | |
# uses: rtCamp/action-slack-notify@v2 | |
# env: | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
# SLACK_MESSAGE: 'success :rocket:' | |
# SLACK_TITLE: "Github action: behat success" | |
# SLACK_CHANNEL: behat-git-notifications | |
fail: | |
name: Actions to run on fail | |
needs: [cci, asp, champ, coco, usrse, careers, gpc, ky, nect, wip] | |
if: ${{ failure() }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Comment on pull request | |
if: "${{ env.prnum != '' }}" | |
run: | | |
gh pr comment $prnum -R $REPO --body "🤖 -=-=-=- Behat Test has failed 😩 -=-=-=- 🤖" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
prnum: ${{ github.event.inputs.prnum }} | |
REPO: "${{ github.server_url }}/${{ github.repository }}" | |
- name: Slack Notification Fail | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_MESSAGE: ':octagonal_sign: behat tests failed :octagonal_sign:' | |
SLACK_TITLE: "Github action: behat failure" | |
SLACK_CHANNEL: behat-git-notifications |