fix: simulation test #34
This file contains 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 test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodule: true | |
- name: Install Gurobi | |
run: | | |
cd /opt | |
echo "GRB_VERSION=$GRB_VERSION" >> $GITHUB_ENV | |
echo "GRB_SHORT_VERSION=$GRB_SHORT_VERSION" >> $GITHUB_ENV | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y \ | |
ca-certificates \ | |
wget | |
sudo update-ca-certificates | |
wget -v https://packages.gurobi.com/${GRB_SHORT_VERSION}/gurobi_server${GRB_VERSION}_linux64.tar.gz | |
tar -xvf gurobi_server${GRB_VERSION}_linux64.tar.gz | |
rm -f gurobi_server${GRB_VERSION}_linux64.tar.gz | |
mv -f gurobi_server* gurobi_server | |
rm -rf gurobi/linux64/docs | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y \ | |
p7zip-full \ | |
zip | |
sudo update-ca-certificates | |
echo "GRB_HOME=$GRB_HOME" >> $GITHUB_ENV | |
echo "PATH=${PATH}:${GRB_HOME}/bin" >> $GITHUB_ENV | |
env: | |
GRB_VERSION: 9.1.1 | |
GRB_SHORT_VERSION: 9.1 | |
GRB_HOME: /opt/gurobi_server/linux64 | |
- name: Gurobi License setting | |
run: | | |
sudo mkdir /opt/gurobi | |
sudo echo WLSACCESSID=${{ secrets.WLSACCESSID }} > /opt/gurobi/gurobi.lic | |
sudo echo WLSSECRET=${{ secrets.WLSSECRET }} >> /opt/gurobi/gurobi.lic | |
sudo echo LICENSEID=${{ secrets.LICENSEID }} >> /opt/gurobi/gurobi.lic | |
- name: Install dependencies | |
run: | | |
sudo wget -qO- "https://cmake.org/files/v3.20/cmake-3.20.2-linux-x86_64.tar.gz" | sudo tar --strip-components=1 -xz -C /usr/local | |
sudo apt-get update | |
sudo apt-get install -y \ | |
build-essential \ | |
clang \ | |
clang-format \ | |
vim \ | |
git \ | |
ninja-build \ | |
gdb \ | |
python3-pip \ | |
verilator | |
echo "PATH=/home/verilator/bin:${PATH}" >> $GITHUB_ENV | |
echo "GRB_LICENSE_FILE=/opt/gurobi/gurobi.lic" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
echo $PATH | |
cmake -S . -B build -GNinja | |
cmake --build build -j4 | |
- name: Test | |
run: | | |
cd build && ctest -V | |