podman

Форк
0
/
check_cirrus_cron.yml 
92 строки · 3.4 Кб
1
---
2

3
# Format Ref: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
4

5
# Required to un-FUBAR default ${{github.workflow}} value
6
name: check_cirrus_cron
7

8
on:
9
    # Note: This only applies to the main branch.
10
    schedule:
11
        # N/B: This should correspond to a period slightly after
12
        # the last job finishes running.  See job defs. at:
13
        # https://cirrus-ci.com/settings/repository/6707778565701632
14
        - cron:  '03 03 * * 1-5'
15
    # Debug: Allow triggering job manually in github-actions WebUI
16
    workflow_dispatch: {}
17
    # Allow re-use of this workflow by other repositories
18
    # Ref: https://docs.github.com/en/actions/using-workflows/reusing-workflows
19
    workflow_call:
20
      secrets:
21
        SECRET_CIRRUS_API_KEY:
22
          required : true
23
        ACTION_MAIL_SERVER:
24
          required: true
25
        ACTION_MAIL_USERNAME:
26
          required: true
27
        ACTION_MAIL_PASSWORD:
28
          required: true
29
        ACTION_MAIL_SENDER:
30
          required: true
31

32
env:
33
    # CSV listing of e-mail addresses for delivery failure or error notices
34
    RCPTCSV: podman-monitor@lists.podman.io
35
    # Filename for table of build-id to cron-name data
36
    # (must be in $GITHUB_WORKSPACE/artifacts/)
37
    ID_NAME_FILEPATH: './artifacts/id_name.txt'
38

39
permissions:
40
  contents: read
41

42
jobs:
43
    cron_failures:
44
        runs-on: ubuntu-latest
45
        steps:
46
            # This is where the scripts live
47
            - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
48
              with:
49
                  repository: containers/podman
50
                  ref: 'main'
51
                  persist-credentials: false
52

53
            - name: Get failed cron names and Build IDs
54
              id: cron
55
              run: './.github/actions/check_cirrus_cron/cron_failures.sh'
56

57
            - if: steps.cron.outputs.failures > 0
58
              shell: bash
59
              run: './.github/actions/check_cirrus_cron/make_email_body.sh'
60

61
            - if: steps.cron.outputs.failures > 0
62
              name: Send failure notification e-mail
63
              # Ref: https://github.com/dawidd6/action-send-mail
64
              uses: dawidd6/action-send-mail@v3.12.0
65
              with:
66
                server_address: ${{secrets.ACTION_MAIL_SERVER}}
67
                server_port: 465
68
                username: ${{secrets.ACTION_MAIL_USERNAME}}
69
                password: ${{secrets.ACTION_MAIL_PASSWORD}}
70
                subject: Cirrus-CI cron build failures on ${{github.repository}}
71
                to: ${{env.RCPTCSV}}
72
                from: ${{secrets.ACTION_MAIL_SENDER}}
73
                body: file://./artifacts/email_body.txt
74

75
            - if: always()
76
              uses: actions/upload-artifact@v4
77
              with:
78
                  name: ${{ github.job }}_artifacts
79
                  path: artifacts/*
80

81
            - if: failure()
82
              name: Send error notification e-mail
83
              uses: dawidd6/action-send-mail@v3.12.0
84
              with:
85
                server_address: ${{secrets.ACTION_MAIL_SERVER}}
86
                server_port: 465
87
                username: ${{secrets.ACTION_MAIL_USERNAME}}
88
                password: ${{secrets.ACTION_MAIL_PASSWORD}}
89
                subject: Github workflow error on ${{github.repository}}
90
                to: ${{env.RCPTCSV}}
91
                from: ${{secrets.ACTION_MAIL_SENDER}}
92
                body: "Job failed: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
93

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.