Skip to content

(CI) Download msvc version of the lib. #114

(CI) Download msvc version of the lib.

(CI) Download msvc version of the lib. #114

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
Generic:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
app: [pendulum, tic-tac-toe, mnist, stickgame]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Doxygen
if: matrix.os == 'ubuntu-latest'
run: sudo apt install doxygen
- name: Install gegelati Windows
if: matrix.os == 'windows-latest'
run: |
if [[ "${{ github.ref }}" == *"master" ]] || [[ "${{ github.base_ref }}" == *"master" ]] || [[ "${{ github.ref }}" == *"tags/v"* ]]; then curl -L -J $(curl -s https://api.github.com/repos/gegelati/gegelati/releases/latest | grep "browser_download_url.*zip" | cut -d':' -f 2,3 | tr -d \") -o gegelatilib-latest.zip; else curl https://gegelati.github.io/neutral-builds/gegelatilib-msvc-latest-develop.zip -o gegelatilib-latest.zip; fi
7z x gegelatilib-latest.zip
echo "LATEST_FOLDER=$(find -maxdepth 1 -regextype posix-egrep -regex "./gegelatilib-[0-9]+\.[0-9]+\.[0-9]+\$" | cut -d'/' -f 2)" >> $GITHUB_ENV
shell: bash
- name: Install gegelati Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
git clone --branch $([ ${GITHUB_REF##*/} == "master" ] && echo "master" || echo "develop") $() https://github.com/gegelati/gegelati.git
cd gegelati/bin
cmake .. -DCMAKE_BUILD_TYPE=Release
sudo make install
- name: Compile appli
run: |
cd ${{ matrix.app }}
if [ "${{ matrix.os }}" = "windows-latest" ]; then cp -r ../${LATEST_FOLDER} ./lib/ ; fi
cd bin
if [ "${{ matrix.os }}" = "windows-latest" ]; then cmake .. -DTESTING=1 ; fi
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then cmake .. -DTESTING=1 -DCMAKE_BUILD_TYPE=Release ; fi
if [ "${{ matrix.os }}" = "windows-latest" ]; then cmake --build . --target ${{ matrix.app }} --config Release ; fi
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then cmake --build . --target ${{ matrix.app }} ; fi
shell: bash
- name: Run appli
run: ./${{ matrix.app }}/bin/Release/${{ matrix.app }}
shell: bash
Codegen:
runs-on: ubuntu-latest
strategy:
matrix:
app: [pendulum, stickgame]
name: Codegen-${{ matrix.app }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Doxygen
run: sudo apt install doxygen
- name: Install gegelati Ubuntu
run: |
git clone --branch $([ ${GITHUB_REF##*/} == "master" ] && echo "master" || echo "develop") $() https://github.com/gegelati/gegelati.git
cd gegelati/bin
cmake .. -DCMAKE_BUILD_TYPE=Release
sudo make install
- name: Compile Code Generation
run: |
cd ${{ matrix.app }}
cd bin
cmake .. -DTESTING=1 -DCMAKE_BUILD_TYPE=Release
cmake --build . --target ${{ matrix.app }}CodeGenCompile
- name: Run Code Generation
run: |
cd ${{ matrix.app }}
cd bin
cmake --build . --target ${{ matrix.app }}ExecCodeGen
shell: bash
- name: Compile and Run Generated Code
run: |
cd ${{ matrix.app }}
cd bin
cmake --build . --target ${{ matrix.app }}InferenceCodeGen
./Release/${{ matrix.app }}InferenceCodeGen >> codegen.log
tail -n 3 codegen.log
shell: bash
- name: Compile and run Reference TPG
run: |
cd ${{ matrix.app }}
cd bin
cmake --build . --target ${{ matrix.app }}TPGInference
./Release/${{ matrix.app }}TPGInference >> tpg.log
tail -n 3 tpg.log
echo "Count the number of line that differs between the two logs"
set +o pipefail
NB_DIFF=$(diff -y --suppress-common-lines codegen.log tpg.log | wc -l)
echo "(should be 3 if only the measured execution times differ)"
echo "$NB_DIFF"
if [ $NB_DIFF -le 3 ]; then exit 0; else exit 1; fi
shell: bash