Skip to content

Commit 586d499

Browse files
committed
ci: skip FreeBSD/macOS jobs in a fork
When I added these workflows (tarantool#13246, tarantool#13247), I had two points in the head: * I don't want to bloat the workflows with many rules where and when to run. Instead, I want them to be tiny wrappers around commands they're run. * The workflows are able to run in forks and it may be useful for debugging purposes. All the other workflows are disabled in the forks, mainly because they use self-hosted runners and secrets (tarantool#6913). This is not the case here. However, I found that I don't like that something is run in my fork by default, because it only spend resources, while I anyway look for the status in a pull request. The fork works are a bucket of branches for me, nothing over that. Let's skip the runs in forks. It is still possible to perform debugging on the runners using these workflows in a fork, but now it requires a manual action: drop the `if` clauses. NO_DOC=ci NO_CHANGELOG=ci NO_TEST=ci
1 parent 1491b65 commit 586d499

2 files changed

Lines changed: 24 additions & 9 deletions

File tree

‎.github/workflows/freebsd.yml‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@ permissions:
77

88
jobs:
99
freebsd:
10-
# Run on a branch push and on a pull request from a fork. A pull request
11-
# from a branch of this repository is tested by the push of that branch.
10+
# | Event | Runs? |
11+
# | ------------------------------------- | ------ |
12+
# | Push a branch to a fork | no |
13+
# | Push a branch to tarantool/tarantool | yes |
14+
# | Pull request from a fork | yes |
15+
# | Pull request from tarantool/tarantool | no[^1] |
16+
#
17+
# [^1]: Branch push status is shown in the pull request in the case.
1218
if: |
13-
github.event_name == 'push' ||
14-
github.event_name == 'pull_request' &&
15-
github.event.pull_request.head.repo.full_name != github.repository
19+
github.repository_owner == 'tarantool' && (
20+
github.event_name == 'push' ||
21+
github.event_name == 'pull_request' &&
22+
github.event.pull_request.head.repo.full_name != github.repository)
1623
1724
# ubuntu-latest will be 26.04 soon. Switch ahead of time.
1825
#

‎.github/workflows/macos.yml‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@ on: [push, pull_request]
44

55
jobs:
66
macos:
7-
# Run on a branch push and on a pull request from a fork. A pull request
8-
# from a branch of this repository is tested by the push of that branch.
9-
if: github.event_name == 'push' ||
7+
# | Event | Runs? |
8+
# | ------------------------------------- | ------ |
9+
# | Push a branch to a fork | no |
10+
# | Push a branch to tarantool/tarantool | yes |
11+
# | Pull request from a fork | yes |
12+
# | Pull request from tarantool/tarantool | no[^1] |
13+
#
14+
# [^1]: Branch push status is shown in the pull request in the case.
15+
if: |
16+
github.repository_owner == 'tarantool' && (
17+
github.event_name == 'push' ||
1018
github.event_name == 'pull_request' &&
11-
github.event.pull_request.head.repo.full_name != github.repository
19+
github.event.pull_request.head.repo.full_name != github.repository)
1220
1321
runs-on: macos-latest
1422

0 commit comments

Comments
 (0)