MM-52712: Prevent CI cancellation in master (round 2) (#23293)

We discovered that cancel-in-progress only controls
in-progress jobs. Which means that pending jobs will _always_
be cancelled regardless. There is an open discussion:
https://github.com/orgs/community/discussions/5435
which was closed saying this is how the feature is designed.

We try to work around this by refactoring into separate reusable
workflows and having concurrency only for PR workflows.

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Agniva De Sarker
2023-05-09 23:49:06 +05:30
коммит произвёл GitHub
родитель 11b08edf94
Коммит 77a24f96d6
12 изменённых файлов: 114 добавлений и 40 удалений

17
.github/workflows/webapp-ci-pr.yml поставляемый Обычный файл
Просмотреть файл

@@ -0,0 +1,17 @@
name: Web App CI PR
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This file just imports the template yml
# and runs it with concurrency. We have to do this in this way
# because the concurrency label cannot be added conditionally
# and it _always_ cancels pending workflows. So master CI builds
# always kept getting canceled.
jobs:
pr-ci:
uses: ./.github/workflows/webapp-ci-template.yml