ogma-core: De-duplicate cFS application data. Refs #602.
#512
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: cfs-ghc-8.6-cabal-2.4 | |
| on: | |
| - pull_request | |
| - push | |
| jobs: | |
| cabal: | |
| name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| cabal: ["2.4"] | |
| ghc: | |
| - "8.6" | |
| steps: | |
| - uses: haskell-actions/setup@main | |
| id: setup-haskell-cabal | |
| name: Setup Haskell | |
| continue-on-error: true | |
| with: | |
| ghc-version: ${{ matrix.ghc }} | |
| cabal-version: ${{ matrix.cabal }} | |
| - name: Set up cabal | |
| run: | | |
| cabal --version | |
| ghc --version | |
| sed -i -e 's/^.*\<secure: True/ secure: False/g' $HOME/.cabal/config | |
| cabal update | |
| - name: Prepare environment | |
| run: | | |
| echo "$HOME/.ghcup/bin" >> $GITHUB_PATH | |
| echo "$HOME/.cabal/bin" >> $GITHUB_PATH | |
| - uses: actions/checkout@v4 | |
| - name: Create sandbox | |
| run: | | |
| echo "$PWD/.cabal-sandbox/bin" >> $GITHUB_PATH | |
| cabal v1-sandbox init | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libbz2-dev libexpat-dev cmake make psmisc | |
| cabal v1-install alex happy --constraint="alex <3.5.4.1 || >3.5.4.1" | |
| cabal v1-install BNFC | |
| - name: Install ogma | |
| run: | | |
| cabal v1-install ogma-**/ --constraint="aeson >= 2.0.3.0" | |
| - name: Generate and enable cFS app | |
| run: | | |
| # Clone standard cFS | |
| git clone --recursive -b v7.0.1 https://github.com/nasa/cfs.git | |
| # Generate cFS app with Ogma | |
| ogma cfs --target-dir cfs/apps/ \ | |
| --input-file ogma-cli/examples/cfs-001-hello-ogma/expressions.json \ | |
| --input-format ogma-cli/examples/cfs-001-hello-ogma/json-format.cfg \ | |
| --prop-format literal \ | |
| --variable-db ogma-cli/examples/cfs-001-hello-ogma/db.json \ | |
| --template-vars ogma-cli/examples/cfs-001-hello-ogma/extra-vars.json | |
| cp ogma-cli/examples/cfs-001-hello-ogma/extra.h cfs/apps/copilot/fsw/src/ | |
| # Enable Ogma-generated cFS app in cFS | |
| sed -i -e 's/\(SET(cpu1_APPLIST.*\))/\1 copilot)/g' cfs/sample_defs/targets.cmake | |
| sed -i '/"CFE_APP, sample_app,/a \ "CFE_APP, copilot_cfs, COPILOT_AppMain, COPILOT_APP, 50, 32768, 0x0, 0;\\n"' cfs/sample_defs/generate_startup.cmake | |
| - name: Compile cFS app and ground station | |
| run: | | |
| cd cfs/ | |
| # Compile cFS | |
| make native_std.prep | |
| make native_std.install -j$(nproc) | |
| # Compile ground station | |
| make -C tools/cFS-GroundSystem/Subsystems/cmdUtil/ | |
| - name: Run cFS app | |
| run: | | |
| cd cfs/ | |
| # Send two messages to the cFS app after 10 and 15 seconds. One of them | |
| # should trigger the monitor. | |
| setsid --fork bash -c 'sleep 10; tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil --host=localhost --port=1234 --endian LE --pktid=0x1878 -C 0 --long=0' | |
| setsid --fork bash -c 'sleep 15; tools/cFS-GroundSystem/Subsystems/cmdUtil/cmdUtil --host=localhost --port=1234 --endian LE --pktid=0x1878 -C 0 --long=5' | |
| # Gracefully stop cFS after 20 seconds | |
| setsid --fork bash -c 'sleep 20; sudo killall -SIGINT core-cpu1' | |
| # Start cFS | |
| cd build-native_std/exe/cpu1/ | |
| sudo ./core-cpu1 && echo "Success" |