Skip to content

TEMP: trying to add failure notifications for main-check CI #56

TEMP: trying to add failure notifications for main-check CI

TEMP: trying to add failure notifications for main-check CI #56

Workflow file for this run

name: Pycloudlib Post Merge Check
on:
push:
branches:
- main
- adding-main-check-ci-failures-notification
jobs:
post-merge-tests:
runs-on: ubuntu-latest
steps:
# - name: Install dependencies
# run: |
# sudo apt-get update -q
# sudo apt-get install -qy distro-info tox
# sudo apt-get remove --yes --purge azure-cli
# - name: Initialize Pycloudlib
# env:
# GCE_CREDENTIALS_JSON: ${{ secrets.GCE_CREDENTIALS_JSON }}
# PYCLOUDLIB_TOML: ${{ secrets.PYCLOUDLIB_TOML }}
# run: |
# ssh-keygen -P "" -q -f ~/.ssh/cloudinit_id_rsa
# mkdir -p ~/.config
# echo "$GCE_CREDENTIALS_JSON" > ~/.config/gce_credentials
# echo "$PYCLOUDLIB_TOML" > ~/.config/pycloudlib.toml
- name: Git checkout
uses: actions/checkout@v3
#- name: Run CI integration tests
# run: GOOGLE_APPLICATION_CREDENTIALS=~/.config/gce_credentials tox -e integration-tests-main-check
# do thing that will intentionally fail to test failure notification
- name: Fail the job
run: exit 1
notify-on-failure:
needs: post-merge-tests
if: failure()
runs-on: ubuntu-latest
steps:
- name: Copy issue body to /tmp
run: cp .github/main-check-issue.md /tmp/issue-body.md
- name: Add job run link to issue body
run: 'echo "\nJob run link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> /tmp/issue-body.md'
- name: Create GitHub issue on failure
uses: peter-evans/create-issue-from-file@v4
with:
title: 'CI Integration Tests Failed'
content-filepath: /tmp/issue-body.md
labels: bug
assignees: a-dubs