diff --git a/.github/workflows/est-workflow-dev.yml b/.github/workflows/est-workflow-dev.yml index 58f6a22a..287b5e2c 100644 --- a/.github/workflows/est-workflow-dev.yml +++ b/.github/workflows/est-workflow-dev.yml @@ -37,7 +37,26 @@ jobs: run: | docker compose up --build -d - - name: Send Slack notification + - name: Run pyTesting.py + id: pytesting + run: | + output=$(python src/pyTesting.py) + if [ "$output" != "True" ]; then + echo "PyTesting failed with output: $output" + exit 1 + fi + + - name: Send failure Slack notification + if: failure() + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + run: | + curl -X POST -H 'Content-type: application/json' --data "{ + \"text\": \"The deployment failed during the pyTesting step. Please check the output for details.\" + }" $SLACK_WEBHOOK_URL + + - name: Send success Slack notification + if: success() env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} run: | diff --git a/.github/workflows/est-workflow-staging.yml b/.github/workflows/est-workflow-staging.yml index 62dcb180..1b639efe 100644 --- a/.github/workflows/est-workflow-staging.yml +++ b/.github/workflows/est-workflow-staging.yml @@ -1,4 +1,4 @@ -name: Deploy EST Frontend and Backend to Staging +name: Deploy EST Frontend and Backend to staging on: push: @@ -37,10 +37,29 @@ jobs: run: | docker compose up --build -d - - name: Send Slack notification + - name: Run pyTesting.py + id: pytesting + run: | + output=$(python src/pyTesting.py) + if [ "$output" != "True" ]; then + echo "PyTesting failed with output: $output" + exit 1 + fi + + - name: Send failure Slack notification + if: failure() + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + run: | + curl -X POST -H 'Content-type: application/json' --data "{ + \"text\": \"The deployment failed during the pyTesting step. Please check the output for details.\" + }" $SLACK_WEBHOOK_URL + + - name: Send success Slack notification + if: success() env: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} run: | curl -X POST -H 'Content-type: application/json' --data "{ \"text\": \"The build is complete and the staging environment is now available. Please click the following link to access it: \" - }" $SLACK_WEBHOOK_URL \ No newline at end of file + }" $SLACK_WEBHOOK_URL diff --git a/src/pyTesting.py b/src/pyTesting.py new file mode 100644 index 00000000..acc25ef6 --- /dev/null +++ b/src/pyTesting.py @@ -0,0 +1,2 @@ +if __name__ == "__main__": + print(True)