|
| 1 | +# Cross-compile https://github.com/fprime-community/fprime-workshop-led-blinker |
| 2 | +# Runs integration tests on aarch64-linux |
| 3 | + |
| 4 | +name: "External Repo: AArch64 Linux LedBlinker" |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: [ devel, release/** ] |
| 9 | + pull_request: |
| 10 | + # The branches below must be a subset of the branches above |
| 11 | + branches: [ devel, release/** ] |
| 12 | + paths-ignore: |
| 13 | + - 'docs/**' |
| 14 | + - '**.md' |
| 15 | + - '.github/actions/spelling/**' |
| 16 | + - '.github/ISSUE_TEMPLATE/**' |
| 17 | + |
| 18 | +env: |
| 19 | + AARCH64_TOOLCHAIN_DIR: /tmp/aarch64-toolchain |
| 20 | + AARCH64_TOOLCHAIN_URL: https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz |
| 21 | + ARM_TOOLS_PATH: /tmp/aarch64-toolchain |
| 22 | + |
| 23 | +jobs: |
| 24 | + get-branch: |
| 25 | + name: "Get target branch" |
| 26 | + uses: ./.github/workflows/reusable-get-pr-branch.yml |
| 27 | + with: |
| 28 | + target_repository: fprime-community/fprime-workshop-led-blinker |
| 29 | + |
| 30 | + cross-compilation: |
| 31 | + name: "Cross Compilation" |
| 32 | + runs-on: ubuntu-22.04 |
| 33 | + needs: get-branch |
| 34 | + steps: |
| 35 | + - name: "Checkout target repository" |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: false |
| 39 | + repository: fprime-community/fprime-workshop-led-blinker |
| 40 | + ref: ${{ needs.get-branch.outputs.target-branch }} |
| 41 | + - name: "Overlay current F´ revision" |
| 42 | + uses: actions/checkout@v4 |
| 43 | + with: |
| 44 | + submodules: true |
| 45 | + path: ./fprime |
| 46 | + fetch-depth: 0 |
| 47 | + - uses: ./fprime/.github/actions/setup |
| 48 | + with: |
| 49 | + location: ./fprime |
| 50 | + - name: "Download and Setup AArch64 Linux Toolchain" |
| 51 | + run: | |
| 52 | + mkdir -p ${AARCH64_TOOLCHAIN_DIR} |
| 53 | + wget -q ${AARCH64_TOOLCHAIN_URL} |
| 54 | + tar -xf $(basename ${AARCH64_TOOLCHAIN_URL}) -C ${AARCH64_TOOLCHAIN_DIR} --strip-components 1 |
| 55 | + echo "${AARCH64_TOOLCHAIN_DIR}/bin" >> $GITHUB_PATH |
| 56 | + - name: "Generate AArch64 Linux Build Cache" |
| 57 | + run: | |
| 58 | + fprime-util generate aarch64-linux |
| 59 | + - name: "Build AArch64 Linux" |
| 60 | + run: | |
| 61 | + fprime-util build aarch64-linux |
| 62 | + - name: "Prepare artifacts" |
| 63 | + run: | |
| 64 | + mkdir -p aarch64-linux-artifacts |
| 65 | + cp -r ./build-artifacts aarch64-linux-artifacts |
| 66 | + cp -r Components/Led/test/int aarch64-linux-artifacts |
| 67 | + - name: 'Archive Build Artifacts' |
| 68 | + uses: actions/upload-artifact@v4 |
| 69 | + with: |
| 70 | + name: aarch64-linux-artifacts |
| 71 | + path: aarch64-linux-artifacts |
| 72 | + retention-days: 5 |
| 73 | + |
| 74 | + aarch64-integration: |
| 75 | + name: "AArch64 Linux Integration Tests" |
| 76 | + runs-on: [self-hosted, aarch64-linux] |
| 77 | + needs: cross-compilation |
| 78 | + steps: |
| 79 | + - name: "Checkout F´ Repository" |
| 80 | + uses: actions/checkout@v4 |
| 81 | + with: |
| 82 | + sparse-checkout: 'requirements.txt' |
| 83 | + sparse-checkout-cone-mode: false |
| 84 | + - name: "Setup environment" |
| 85 | + run: | |
| 86 | + python -m venv venv |
| 87 | + . venv/bin/activate |
| 88 | + pip install -r requirements.txt |
| 89 | + - name: "Artifacts Download" |
| 90 | + uses: actions/download-artifact@v4 |
| 91 | + with: |
| 92 | + name: aarch64-linux-artifacts |
| 93 | + - name: Run Integration Tests |
| 94 | + run: | |
| 95 | + . venv/bin/activate |
| 96 | + mkdir -p ci-logs |
| 97 | + chmod +x ./build-artifacts/aarch64-linux/LedBlinker/bin/LedBlinker |
| 98 | + fprime-gds --ip-client -d ./build-artifacts/aarch64-linux/LedBlinker --logs ./ci-logs & |
| 99 | + sleep 10 |
| 100 | + pytest --dictionary ./build-artifacts/aarch64-linux/LedBlinker/dict/LedBlinkerTopologyDictionary.json ./int/led_integration_tests.py |
| 101 | + - name: 'Archive logs' |
| 102 | + uses: actions/upload-artifact@v4 |
| 103 | + if: always() |
| 104 | + with: |
| 105 | + name: aarch64-linux-logs |
| 106 | + path: ci-logs |
| 107 | + retention-days: 5 |
0 commit comments