~aleteoryx/muditaos

2b754af627a1d4d93fdbf28c79eab64db5ea72cd — Piotr Leniec 5 years ago dc99ba5
[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
1 files changed, 12 insertions(+), 1 deletions(-)

M .github/workflows/main.yml
M .github/workflows/main.yml => .github/workflows/main.yml +12 -1
@@ 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