github: simplify runner assignment to server-based tags #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: GPL-2.0 | ||
| --- | ||
| name: Run kdevops CI Workflow - Reusable | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| ci_workflow: | ||
| description: "CI Workflow" | ||
| required: true | ||
| default: 'blktests_nvme' | ||
| type: string | ||
| kernel_ref: | ||
| description: "Linux tree git reference (branch/tag/commit-id)" | ||
| required: true | ||
| default: 'master' | ||
| type: string | ||
| kernel_tree: | ||
| description: "Linux kernel tree to use" | ||
| required: true | ||
| default: 'linux' | ||
| type: string | ||
| test_mode: | ||
| description: 'Testing mode' | ||
| required: false | ||
| default: 'linux-ci' | ||
| type: string | ||
| tests: | ||
| description: 'Custom test to run (for kdevops-ci mode only)' | ||
| required: false | ||
| default: '' | ||
| type: string | ||
| jobs: | ||
| setup: | ||
| name: Setup kdevops workspace | ||
| runs-on: ${{ | ||
| inputs.test_mode == 'kdevops-ci' | ||
| && fromJSON('["self-hosted", "Linux", "X64", "kdevops-ci"]') | ||
| || fromJSON('["self-hosted", "Linux", "X64", "linux-ci"]') | ||
| }} | ||
| steps: | ||
| - name: Checkout dkruces/kdevops | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| clean: false | ||
| - name: kdevops setup | ||
| uses: ./.github/actions/setup | ||
| with: | ||
| ci_workflow: ${{ inputs.ci_workflow }} | ||
| dir: ${{ inputs.ci_workflow }} | ||
| kernel_ref: ${{ inputs.kernel_ref }} | ||
| kernel_tree: ${{ inputs.kernel_tree }} | ||
| test_mode: ${{ inputs.test_mode }} | ||
| test: | ||
| name: Run kdevops ci-test | ||
| runs-on: ${{ | ||
| inputs.test_mode == 'kdevops-ci' | ||
| && fromJSON('["self-hosted", "Linux", "X64", "kdevops-ci"]') | ||
| || fromJSON('["self-hosted", "Linux", "X64", "linux-ci"]') | ||
| }} | ||
| needs: [setup] | ||
| timeout-minutes: 120 | ||
| steps: | ||
| - name: kdevops ci-test | ||
| uses: ./.github/actions/test | ||
| with: | ||
| ci_workflow: ${{ inputs.ci_workflow }} | ||
| dir: ${{ inputs.ci_workflow }} | ||
| test_mode: ${{ inputs.test_mode }} | ||
| tests: ${{ inputs.tests }} | ||
| archive: | ||
| name: Archive kdevops | ||
| runs-on: ${{ | ||
| inputs.test_mode == 'kdevops-ci' | ||
| && fromJSON('["self-hosted", "Linux", "X64", "kdevops-ci"]') | ||
| || fromJSON('["self-hosted", "Linux", "X64", "linux-ci"]') | ||
| }} | ||
| needs: [setup, test] | ||
| steps: | ||
| - name: Start SSH Agent | ||
| uses: webfactory/[email protected] | ||
| with: | ||
| ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
| - name: Archive ci-test results | ||
| uses: ./.github/actions/archive | ||
| with: | ||
| ci_workflow: ${{ inputs.ci_workflow }} | ||
| dir: ${{ inputs.ci_workflow }} | ||
| - name: Upload our kdevops results archive | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: kdevops-ci-results | ||
| path: ${{ inputs.ci_workflow }}/kdevops/archive/*.zip | ||
| cleanup: | ||
| name: Cleanup kdevops workspace | ||
| runs-on: ${{ | ||
| inputs.test_mode == 'kdevops-ci' | ||
| && fromJSON('["self-hosted", "Linux", "X64", "kdevops-ci"]') | ||
| || fromJSON('["self-hosted", "Linux", "X64", "linux-ci"]') | ||
| }} | ||
| needs: [setup, test, archive] | ||
| if: always() | ||
| steps: | ||
| - name: kdevops cleanup | ||
| uses: ./.github/actions/cleanup | ||
| with: | ||
| dir: ${{ inputs.ci_workflow }} | ||