diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..8d9fc7a1b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI for master branch PR + +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + - name: Show version of tools + run: | + gcc -v + g++ -v + make -v + cmake --version + + - name: Cache apt packages + uses: actions/cache@v3 + with: + path: /var/cache/apt/archives/*.deb + key: ${{ runner.os }}-apt-${{ hashFiles('apt-packages.txt') }} + + - name: Install dependencies + run: | + sudo apt-get install libboost-dev + sudo apt-get install libprotobuf-dev protobuf-compiler libprotoc-dev libgoogle-perftools-dev + sudo apt-get install libboost-test-dev libboost-program-options-dev libboost-system-dev + sudo apt-get install libc-ares-dev libcurl4-openssl-dev + sudo apt-get install zlib1g-dev libgd-dev + + - name: Set up environment variables + run: | + echo "BUILD_TYPE=debug" >> $GITHUB_ENV + echo "BUILD_TYPE=release" >> $GITHUB_ENV + + - name: Build project + run: | + ./build.sh