Skip to content

Commit

Permalink
.github/workflows: trigger gitlab as soon as possible
Browse files Browse the repository at this point in the history
Previously, we gated the GitLab tests on the unit tests. However, these now
take ~10 minutes, which is just annoying for engineers. This commit changes
the trigger to fire immediately after the PR is updated. This should save our
engineers 10 minutes on every push.

Regarding higher infra costs: Engineers are more expensive. :P

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
  • Loading branch information
ondrejbudai committed Jul 10, 2023
1 parent 0e4a9e5 commit a58224a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,20 +195,6 @@ jobs:
- name: Run rpmlint
run: rpmlint rpmbuild/SRPMS/*

gitlab-ci-helper:
name: "Gitlab CI trigger helper"
runs-on: ubuntu-latest
env:
SKIP_CI: ${{ (github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP')) && !contains(github.event.pull_request.labels.*.name, 'WIP+test') }}
steps:
- name: Write PR status
run: echo "$SKIP_CI" > SKIP_CI.txt
- name: Upload status
uses: actions/upload-artifact@v3
with:
name: PR_STATUS
path: SKIP_CI.txt

kube-linter:
name: "🎀 kube-linter"
runs-on: ubuntu-latest
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/trigger-gitlab-helper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Trigger GitLab

# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
# a push to a pull request triggers two events.
on:
pull_request:
branches:
- "*"
push:
branches:
- main

jobs:
gitlab-ci-helper:
name: "Gitlab CI trigger helper"
runs-on: ubuntu-latest
env:
SKIP_CI: ${{ (github.event.pull_request.draft == true || contains(github.event.pull_request.labels.*.name, 'WIP')) && !contains(github.event.pull_request.labels.*.name, 'WIP+test') }}
steps:
- name: Write PR status
run: echo "$SKIP_CI" > SKIP_CI.txt
- name: Upload status
uses: actions/upload-artifact@v3
with:
name: PR_STATUS
path: SKIP_CI.txt
2 changes: 1 addition & 1 deletion .github/workflows/trigger-gitlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Trigger GitLab CI

on:
workflow_run:
workflows: ["Tests"]
workflows: ["Trigger GitLab"]
types: [completed]

jobs:
Expand Down

0 comments on commit a58224a

Please sign in to comment.