Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/android-protocol-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
name: Central Repository Deployment

runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
name: Central Repository Deployment

runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/android-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ permissions:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
defaults:
run:
working-directory: platforms/android
Expand Down Expand Up @@ -82,6 +83,7 @@ jobs:

build:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout Repository
Expand All @@ -108,6 +110,7 @@ jobs:

lint:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: platforms/android
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/breaking-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
name: Swift
if: inputs.swift == 'true'
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 20
defaults:
run:
working-directory: platforms/swift
Expand All @@ -52,6 +53,7 @@ jobs:
name: Android
if: inputs.android == 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: platforms/android
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
name: Detect Changed Areas
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
android: ${{ steps.platform.outputs.android == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.android == 'true' }}
swift: ${{ steps.platform.outputs.swift == 'true' || steps.platform.outputs.protocol == 'true' || steps.infra.outputs.swift == 'true' }}
Expand Down Expand Up @@ -142,6 +143,7 @@ jobs:
needs: changes
if: needs.changes.outputs.swift == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: platforms/swift/Scripts/check_sample_package_paths
Expand Down Expand Up @@ -214,6 +216,7 @@ jobs:
needs: changes
if: needs.changes.outputs.scripts == 'true'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
Expand Down Expand Up @@ -259,6 +262,7 @@ jobs:
- scripts-test
- breaking-changes
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify all upstream jobs succeeded or were skipped
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
cla:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
actions: write
pull-requests: write
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/label-team-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
jobs:
label:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
pull-requests: write
if: github.event.pull_request.user.type != 'Bot'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/package-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
name: Detect Changed Packages
if: github.event_name == 'pull_request' && github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
android: ${{ steps.package.outputs.android == 'true' || steps.package.outputs.protocol == 'true' || steps.infra.outputs.android == 'true' }}
reactNative: ${{ steps.package.outputs.reactNative == 'true' || steps.package.outputs.protocolTypescript == 'true' || steps.infra.outputs.reactNative == 'true' }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rn-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
swiftlint:
name: SwiftLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
Expand All @@ -22,6 +23,7 @@ jobs:
swiftformat:
name: SwiftFormat & SwiftLint
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 20
env:
MINT_PATH: ${{ github.workspace }}/.mint/lib
MINT_LINK_PATH: ${{ github.workspace }}/.mint/bin
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
stale:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
issues: write

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/swift-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
swiftlint:
name: SwiftLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
Expand All @@ -21,6 +22,7 @@ jobs:
swiftformat:
name: SwiftFormat & SwiftLint
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 20
env:
MINT_PATH: ${{ github.workspace }}/.mint/lib
MINT_LINK_PATH: ${{ github.workspace }}/.mint/bin
Expand Down Expand Up @@ -54,6 +56,7 @@ jobs:
lint-podspec:
name: CocoaPods
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 30
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/platforms/swift/Gemfile
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/swift-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
# workflow doesn't need updating each time a new platform namespace lands.
if: ${{ github.event_name == 'workflow_dispatch' || !contains(github.event.release.tag_name, '/') }}
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 30
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/platforms/swift/Gemfile

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/swift-update-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
check-updates:
runs-on: ${{ vars.MACOS_RUNNER }}
timeout-minutes: 20
env:
MINT_PATH: ${{ github.workspace }}/.mint/lib
MINT_LINK_PATH: ${{ github.workspace }}/.mint/bin
Expand Down
33 changes: 33 additions & 0 deletions scripts/test/workflow_timeouts_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

require "minitest/autorun"
require "yaml"

class WorkflowTimeoutsTest < Minitest::Test
WORKFLOW_GLOB = File.expand_path("../../.github/workflows/*.{yml,yaml}", __dir__)

def test_every_runner_job_declares_a_timeout
missing = workflow_jobs.filter_map do |path, name, job|
"#{relative_path(path)}: #{name}" unless reusable_job?(job) || job.key?("timeout-minutes")
end

assert_empty missing, "Jobs without timeout-minutes:\n#{missing.join("\n")}"
end

private

def workflow_jobs
Dir[WORKFLOW_GLOB].sort.flat_map do |path|
workflow = YAML.safe_load_file(path, aliases: true)
(workflow.fetch("jobs", {})).map { |name, job| [path, name, job] }
end
end

def reusable_job?(job)
job.is_a?(Hash) && job.key?("uses")
end

def relative_path(path)
path.delete_prefix("#{File.expand_path("../..", __dir__)}/")
end
end
Loading