-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (40 loc) · 1.52 KB
/
ci_pipeline.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: CI workflow on push
on:
push:
pull_request:
schedule:
- cron: '0 2 * * *'
jobs:
codeql:
uses: canonical/sdcore-github-workflows/.github/workflows/codeql-analysis.yml@main
lint-report:
uses: canonical/sdcore-github-workflows/.github/workflows/lint-report.yaml@main
static-analysis:
uses: canonical/sdcore-github-workflows/.github/workflows/static-analysis.yaml@main
integration-test:
uses: ./.github/workflows/integration-tests.yaml
secrets: inherit
create-issue:
runs-on: ubuntu-latest
if: ${{ always() && contains(join(needs.*.result, ','), 'failure') }}
needs: [ lint-report, static-analysis, integration-test ]
steps:
- name: Check whether the issue already exists
id: check-issue
continue-on-error: true
run: |
if curl -L -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/$GITHUB_REPOSITORY/issues | grep "CI run failed"; then
echo ISSUE_EXISTS="True" >> $GITHUB_OUTPUT
else
echo ISSUE_EXISTS="False" >> $GITHUB_OUTPUT
fi
- name: Create issue
if: steps.check-issue.outputs.ISSUE_EXISTS == 'False'
uses: dacbd/create-issue-action@main
with:
token: ${{ github.token }}
title: CI run failed
body: |
### Context
[Failed Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
[Codebase](https://github.com/${{ github.repository }}/tree/${{ github.sha }})