diff --git a/.github/workflows/on-pr-opt.yml b/.github/workflows/build-and-run-all-tests.yml similarity index 90% rename from .github/workflows/on-pr-opt.yml rename to .github/workflows/build-and-run-all-tests.yml index 18364734..ff75e6c2 100644 --- a/.github/workflows/on-pr-opt.yml +++ b/.github/workflows/build-and-run-all-tests.yml @@ -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: diff --git a/.github/workflows/build-device.yml b/.github/workflows/build-device.yml index 5a8c0648..335dd2c0 100644 --- a/.github/workflows/build-device.yml +++ b/.github/workflows/build-device.yml @@ -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 @@ -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: diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 3c21f65d..5affd5c2 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -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: diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 08dc84ee..3916e4bf 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -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: diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml deleted file mode 100644 index 158026dd..00000000 --- a/.github/workflows/on-pr.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Mandatory PR checks -name: On PR - -on: - workflow_dispatch: - pull_request: - branches: ["main"] - -jobs: - build-all: - secrets: inherit - uses: ./.github/workflows/build-device.yml - with: - timeout: 15 - - pre-commit: - secrets: inherit - uses: ./.github/workflows/pre-commit.yml diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml deleted file mode 100644 index 673be510..00000000 --- a/.github/workflows/on-push.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: On Push - -on: - workflow_dispatch: - push: - branches: ["main"] - -jobs: - build-all: - secrets: inherit - uses: ./.github/workflows/build-device.yml - with: - timeout: 15 - - pre-commit: - secrets: inherit - uses: ./.github/workflows/pre-commit.yml - - build-tests: - secrets: inherit - strategy: - fail-fast: false - matrix: - test-group: [ - # Enable once we have functional cards with specified architecture. - {arch: grayskull}, - {arch: wormhole_b0}, - # {arch: blackhole}, - ] - uses: ./.github/workflows/build-tests.yml - with: - arch: ${{ matrix.test-group.arch }} - timeout: 15 - - test-all: - secrets: inherit - needs: build-tests - strategy: - fail-fast: false - matrix: - test-group: [ - # Enable once we have functional cards. - {arch: grayskull, card: e75, timeout: 10}, - {arch: grayskull, card: e150, timeout: 10}, - {arch: grayskull, card: e300, timeout: 10}, - {arch: wormhole_b0, card: n150, timeout: 5}, - {arch: wormhole_b0, card: n300, timeout: 15}, - # {arch: blackhole}, - ] - uses: ./.github/workflows/run-tests.yml - with: - arch: ${{ matrix.test-group.arch }} - card: ${{ matrix.test-group.card }} - timeout: ${{ matrix.test-group.timeout }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a4ecb678..c4b2b9a0 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -2,8 +2,11 @@ name: Run Pre-commit Hooks on: - workflow_call: workflow_dispatch: + pull_request: + branches: ["main"] + push: + branches: ["main"] jobs: pre-commit: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 98b2a526..e9d1e6b2 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -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: diff --git a/.github/workflows/test-runner.yaml b/.github/workflows/test-runner.yaml index 74a4d6bf..c871c773 100644 --- a/.github/workflows/test-runner.yaml +++ b/.github/workflows/test-runner.yaml @@ -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: @@ -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: