Skip to content

ogma-cli: Fix incorrect arguments to diagram command in tutorial. Refs #349. #22

ogma-cli: Fix incorrect arguments to diagram command in tutorial. Refs #349.

ogma-cli: Fix incorrect arguments to diagram command in tutorial. Refs #349. #22

name: diagram-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
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- 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 install -y libz-dev libbz2-dev libexpat-dev
cabal v1-install alex happy
cabal v1-install BNFC
- name: Install ogma
run: |
cabal v1-install copilot-4.6 ogma-**/ --constraint="aeson >= 2.0.3.0"
- name: Generate and enable app from diagram
run: |
ogma diagram --target-dir demo \
--prop-format literal \
--mode calculate \
--input-format dot \
--input-file ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot
cd demo/
cabal v1-sandbox init --sandbox=$PWD/../.cabal-sandbox
cabal v1-exec -- runhaskell Copilot.hs
gcc $PWD/../ogma-cli/examples/diagram-001-hello-ogma/main.c monitor.c -I$PWD -o main
- name: Run app and compare against expectation
run: |
cd demo/
if [ "$(./main | sed -n 's/.*new state: \([0-9]\+\).*/\1/p' | paste -sd' ' -)" = "0 1 1 0 2 2 0" ]; then \
echo "Execution of diagram test matches expectation"; \
else \
echo "Mismatch"; \
exit 1; \
fi