Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor our CI yamls #319

Merged
merged 4 commits into from
Nov 21, 2024
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Optional PR checks
name: On PR - Optional
# Build and then run all tests, on all supported archs.
name: Build and run all tests

on:
workflow_dispatch:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
build-tests:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/build-device.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Builds device.
# Build is performed on all supported OS versions.
name: Build Target
name: Build Device

on:
workflow_call:
inputs:
timeout:
required: true
type: number
workflow_dispatch:
inputs:
timeout:
required: true
description: 'The timeout for the build job in minutes'
description: 'The timeout for the job in minutes'
type: number
default: 15
pull_request:
branches: ["main"]
push:
branches: ["main"]

env:
BUILD_TARGET: device
Expand All @@ -25,7 +25,9 @@ env:

jobs:
build:
timeout-minutes: ${{ inputs.timeout }}
# Due to parsing bug, fromJSON is used to convert string to number.
# In pull_request or push events, the input context is not available, stating the default again here.
timeout-minutes: ${{ fromJSON(inputs.timeout || '15') }}
strategy:
fail-fast: false
matrix:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ name: Build and Publish Docker Image

on:
workflow_dispatch:
workflow_call:
inputs:
timeout:
required: true
description: 'The timeout for the job in minutes'
type: number
default: 15

jobs:
build:
timeout-minutes: 15
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ env:

jobs:
build:
timeout-minutes: ${{ inputs.timeout }}
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/on-pr.yml

This file was deleted.

54 changes: 0 additions & 54 deletions .github/workflows/on-push.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
name: Run Pre-commit Hooks

on:
workflow_call:
workflow_dispatch:
pull_request:
branches: ["main"]
push:
branches: ["main"]

jobs:
pre-commit:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ env:

jobs:
test:
timeout-minutes: ${{ inputs.timeout }}
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/test-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ name: Check runner

on:
workflow_dispatch:
inputs:
timeout:
required: true
description: 'The timeout for the job in minutes'
type: number
default: 10

jobs:
check-runners-host:
timeout-minutes: 10
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -52,7 +59,8 @@ jobs:
du -h --max-depth=1 | sort -rh

check-runners-docker:
timeout-minutes: 10
# Due to parsing bug, fromJSON is used to convert string to number
timeout-minutes: ${{ fromJSON(inputs.timeout) }}
strategy:
fail-fast: false
matrix:
Expand Down
Loading