|
| 1 | +# This workflow is intended for reuse by other workflows and will not run directly (no triggers). |
| 2 | +# The behavior is to run the steps of fprime-ci. |
| 3 | +name: "F´ CI - Reusable Workflow" |
| 4 | + |
| 5 | +on: |
| 6 | + workflow_call: |
| 7 | + inputs: |
| 8 | + target_repository: |
| 9 | + description: "Additional external repository to checkout (<owner>/<repo>)" |
| 10 | + required: true |
| 11 | + type: string |
| 12 | + fprime_location: |
| 13 | + description: "Relative path from the external project root to its F´ submodule" |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + default: "./lib/fprime" |
| 17 | + target_ref: |
| 18 | + description: "Branch on target to checkout" |
| 19 | + required: false |
| 20 | + type: string |
| 21 | + default: "devel" |
| 22 | + ci_config_file: |
| 23 | + required: true |
| 24 | + type: string |
| 25 | + run_unit_tests: |
| 26 | + description: "Run an additional job in parallel to run unit tests." |
| 27 | + required: false |
| 28 | + type: boolean |
| 29 | + default: true |
| 30 | + runs_on: |
| 31 | + description: "Platform to run on. Defaults to ubuntu-22.04" |
| 32 | + required: false |
| 33 | + type: string |
| 34 | + default: "ubuntu-22.04" |
| 35 | + runs_on_int: |
| 36 | + description: "Platform to run integration tests on. Defaults to: apple-ci" |
| 37 | + required: false |
| 38 | + type: string |
| 39 | + default: "apple-ci" |
| 40 | + runs_on_ut: |
| 41 | + description: "Platform to run UTs on. Defaults to ubuntu-22.04" |
| 42 | + required: false |
| 43 | + type: string |
| 44 | + default: "ubuntu-22.04" |
| 45 | +jobs: |
| 46 | + build: |
| 47 | + runs-on: ${{ inputs.runs_on }} |
| 48 | + name: "Build" |
| 49 | + steps: |
| 50 | + - name: "Make Space" |
| 51 | + uses: nasa/fprime-actions/make-space@devel |
| 52 | + - name: "Set up target repository" |
| 53 | + uses: nasa/fprime-actions/external-repository-setup@devel |
| 54 | + with: |
| 55 | + target_repository: ${{ inputs.target_repository }} |
| 56 | + fprime_location: ${{ inputs.fprime_location }} |
| 57 | + target_ref: ${{ inputs.target_ref }} |
| 58 | + stage: build |
| 59 | + - name: "Build Binary" |
| 60 | + run: | |
| 61 | + CCACHE_DISABLE=1 fprime-ci -c ${{ inputs.ci_config_file }} --add-stage build |
| 62 | + - name: Archive Results |
| 63 | + uses: actions/upload-artifact@v4 |
| 64 | + with: |
| 65 | + name: archive.tar.gz |
| 66 | + path: ./archive.tar.gz |
| 67 | + integration-tests: |
| 68 | + needs: build |
| 69 | + name: "Integration Tests" |
| 70 | + runs-on: ${{ inputs.runs_on_int }} |
| 71 | + steps: |
| 72 | + - name: "Set up target repository" |
| 73 | + uses: nasa/fprime-actions/external-repository-setup@devel |
| 74 | + with: |
| 75 | + target_repository: ${{ inputs.target_repository }} |
| 76 | + fprime_location: ${{ inputs.fprime_location }} |
| 77 | + target_ref: ${{ inputs.target_ref }} |
| 78 | + stage: int |
| 79 | + - name: Pull Archive Results |
| 80 | + uses: actions/download-artifact@v4 |
| 81 | + with: |
| 82 | + name: archive.tar.gz |
| 83 | + - name: "Integration tests" |
| 84 | + run: | |
| 85 | + fprime-ci -c ${{ inputs.ci_config_file }} --skip-stage build |
0 commit comments