[DW-31] Add a condition that prohibits checks to be run on draft PRs

Unfortunately, github actions doesn't support using "if" property in
defaults and that's why we need to repeat it for all jobs
This commit is contained in:
Piotr Leniec
2020-12-22 09:49:21 +01:00
committed by piotrleniec-mudita
parent dc99ba52ae
commit 2b754af627

View File

@@ -1,10 +1,17 @@
name: CI
on: [pull_request]
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
check_commit_messages:
name: check commit messages
if: github.event.pull_request.draft == false
runs-on: self-hosted
steps:
- name: clone repository
@@ -14,12 +21,14 @@ jobs:
- name: check commit messages
run: ./tools/check_commit_messages.py
build:
if: github.event.pull_request.draft == false
runs-on: self-hosted
steps:
- name: build
run: echo "Placeholder for old CI scripts"
check_copyright_and_style:
name: check copyright and style
if: github.event.pull_request.draft == false
runs-on: self-hosted
steps:
- name: clone repository
@@ -35,6 +44,7 @@ jobs:
build_rt1051_binary:
name: build rt1051 binary
if: github.event.pull_request.draft == false
needs:
- check_copyright_and_style
runs-on: self-hosted
@@ -56,6 +66,7 @@ jobs:
build_linux_binary_and_run_tests:
name: build linux binary and run tests
if: github.event.pull_request.draft == false
needs:
- check_copyright_and_style
runs-on: self-hosted