Part nasa/cFS#1079, Adding specialty PR templates and links to the specialty PR templates in the default PR template. #33
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
| name: Build And Run EdsLib Validation Tests | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| - main | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| workflow_dispatch: | |
| # Force bash to apply pipefail option so pipeline failures aren't masked | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| UPSTREAM_OSAL_REPO: nasa/osal | |
| UPSTREAM_OSAL_REF: dev | |
| jobs: | |
| checks-for-duplicates: | |
| runs-on: ubuntu-latest | |
| # Map a step output to a job output | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@master | |
| with: | |
| concurrent_skipping: 'same_content' | |
| skip_after_successful_duplicate: 'true' | |
| do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | |
| prepare-dependencies: | |
| name: Prepare Dependencies | |
| needs: checks-for-duplicates | |
| if: ${{ needs.checks-for-duplicates.outputs.should_skip != 'true' || contains(github.ref, 'dev') }} | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest | |
| steps: | |
| - name: Cache EdsLib Source | |
| uses: actions/cache@v5 | |
| id: cache-edslib | |
| with: | |
| path: ${{ github.workspace }}/source | |
| key: edslib-source-${{ github.sha }} | |
| - name: Cache OSAL Dependency | |
| uses: actions/cache@v5 | |
| id: cache-osal | |
| with: | |
| path: ${{ github.workspace }}/osal-staging | |
| key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }} | |
| - name: Checkout EdsLib | |
| if: steps.cache-edslib.outputs.cache-hit != 'True' | |
| uses: actions/checkout@v6 | |
| with: | |
| path: source | |
| - name: Set up OSAL | |
| if: steps.cache-osal.outputs.cache-hit != 'True' | |
| uses: ./source/.github/actions/setup-osal | |
| with: | |
| staging-dir: ${GITHUB_WORKSPACE}/osal-staging | |
| upstream-repo: ${{ env.UPSTREAM_OSAL_REPO }} | |
| upstream-ref: ${{ env.UPSTREAM_OSAL_REF }} | |
| build-and-test: | |
| name: Build EdsLib and Execute Tests | |
| needs: [prepare-dependencies] | |
| runs-on: ubuntu-latest | |
| container: ghcr.io/core-flight-system/cfsbuildenv-linux:latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| buildtype: [Debug, Release] | |
| env: | |
| MATRIX_ID: matrix-${{ matrix.buildtype }} | |
| steps: | |
| # Note - caches were updated in "prepare-dependencies" job so all three of these should be a hit | |
| - name: Retrieve Cached EdsLib Source | |
| uses: actions/cache@v5 | |
| id: restore-source | |
| with: | |
| path: ${{ github.workspace }}/source | |
| key: edslib-source-${{ github.sha }} | |
| - name: Retrieve Cached OSAL Dependency | |
| id: restore-osal | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ github.workspace }}/osal-staging | |
| key: edslib-dep-${{ env.UPSTREAM_OSAL_REPO }}@${{ env.UPSTREAM_OSAL_REF }} | |
| # The files extracted from the cache only have owner permissions, | |
| # so in order to make this work it needs to adjust this. | |
| - name: Import OSAL | |
| run: | | |
| sudo cp -rv -t / ${GITHUB_WORKSPACE}/osal-staging/* | |
| sudo find /usr/local -type d -exec chmod go+rx {} \; | |
| sudo find /usr/local -type f -exec chmod go+r {} \; | |
| sudo find /usr/local -type f -path '*/bin/*' -exec chmod go+x {} \; | |
| - name: Refresh Dynamic Linker Cache | |
| run: sudo ldconfig | |
| - name: Set up EdsLib Build | |
| run: cmake | |
| -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE | |
| -DENABLE_UNIT_TESTS=TRUE | |
| -DCMAKE_PREFIX_PATH=/usr/local/lib/cmake | |
| -S source -B ${{ env.MATRIX_ID }} | |
| - name: Build BPLib | |
| working-directory: ${{ env.MATRIX_ID }} | |
| run: make all | |
| - name: Check for Tests | |
| run: if [ -e '${{ env.MATRIX_ID }}/CTestTestfile.cmake' ]; then echo 'RUN_TESTS=True' >> $GITHUB_ENV; fi | |
| - name: Run Tests | |
| working-directory: ${{ env.MATRIX_ID }} | |
| if: env.RUN_TESTS == 'True' | |
| run: ctest --output-on-failure 2>&1 | tee ctest.log | |
| - name: Check Coverage | |
| if: env.MATRIX_ID == 'matrix-Debug' | |
| uses: ./source/.github/actions/check-coverage | |
| with: | |
| binary-dir: ${{ env.MATRIX_ID }} | |
| - name: Assemble Results | |
| run: | | |
| if [ -s '${{ env.MATRIX_ID }}/ctest.log' ]; then | |
| echo '<h2>CTest Execution</h2>' >> $GITHUB_STEP_SUMMARY | |
| echo '<pre>' >> $GITHUB_STEP_SUMMARY | |
| cat '${{ env.MATRIX_ID }}/ctest.log' >> $GITHUB_STEP_SUMMARY | |
| echo '</pre>' >> $GITHUB_STEP_SUMMARY | |
| fi | |
| if [ -s '${{ env.MATRIX_ID }}/lcov-summary.xml' ]; then | |
| cat '${{ env.MATRIX_ID }}/lcov-summary.xml' >> $GITHUB_STEP_SUMMARY | |
| fi |