From 27f3115b0f5ff8009d783c321b7f0bdde2c47525 Mon Sep 17 00:00:00 2001 From: Grant <71123738+Grabt234@users.noreply.github.com> Date: Wed, 27 Mar 2024 07:21:48 +0200 Subject: [PATCH] Workflows (#1) * Chore: Fix for workflows --- .github/workflows/CMake.yml | 12 +++++++++--- .github/workflows/ReleaseCMake.yml | 27 +++++++++++++++++---------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/CMake.yml b/.github/workflows/CMake.yml index 4962100..d566fac 100644 --- a/.github/workflows/CMake.yml +++ b/.github/workflows/CMake.yml @@ -7,7 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - + + - name: Checkout project and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install Requried Libs for FERS run: sudo apt-get install libboost-all-dev libfftw3-dev libhdf5-dev libhdf5-serial-dev build-essential cmake cmake-qt-gui python-all-dev libtinyxml-dev @@ -18,7 +23,7 @@ jobs: cd build pwd # This will print the current working directory after cd ls -a - cmake ../../ -D FERS_LIB_HDF5="/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so" -D FERS_LIB_HDF5_HL="/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so" -D CMAKE_CXX_FLAGS="-I/usr/include/hdf5/serial/" + cmake -S .. -B . -D FERS_LIB_HDF5="/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5.so" -D FERS_LIB_HDF5_HL="/usr/lib/x86_64-linux-gnu/hdf5/serial/libhdf5_hl.so" -D CMAKE_CXX_FLAGS="-I/usr/include/hdf5/serial/" - name: Build FERS run: | @@ -30,9 +35,10 @@ jobs: - name: Generate Validator run: | + cd config_validators mkdir build cd build - cmake + cmake .. - name: Build Validator run: | diff --git a/.github/workflows/ReleaseCMake.yml b/.github/workflows/ReleaseCMake.yml index 53392d8..bcdbc19 100644 --- a/.github/workflows/ReleaseCMake.yml +++ b/.github/workflows/ReleaseCMake.yml @@ -1,12 +1,19 @@ name: C++ Build on Linux -on: [push] +on: + release: + types: [published] jobs: build: runs-on: ubuntu-latest steps: + + - name: Checkout project and submodules + uses: actions/checkout@v3 + with: + submodules: recursive - name: Install Requried Libs run: sudo apt-get install libboost-all-dev libfftw3-dev libhdf5-dev libhdf5-serial-dev build-essential cmake cmake-qt-gui python-all-dev libtinyxml-dev @@ -24,11 +31,11 @@ jobs: - name: Prepare FERS for zip run: | - mkdir build/toZip - cp build/src/fers ~/toZip/fers + mkdir ./toZip + cp build/src/fers ./toZip/fers - name: Go nack to home - run: cd ~ + run: cd .. - name: Install Requried Libs for validator run: sudo apt install libxerces-c-dev @@ -38,7 +45,7 @@ jobs: cd config_validators mkdir build cd build - cmake + cmake .. - name: Build Validator run: | @@ -47,14 +54,14 @@ jobs: - name: Prepare Validator for zip run: | - cp config_validators/build/xml_validator_output ~/toZip/xml_validator_output - cp config_validators/build/kml_visualiser ~/toZip/kml_visualiser - cp config_validators/build/validator ~/toZip/validator + sudo cp config_validators/build/xml_validator_output ./toZip/xml_validator_output + sudo cp config_validators/build/kml_visualiser ./toZip/kml_visualiser + sudo cp config_validators/build/validator ./toZip/validator - name: Zip Docs and Build uses: TheDoctor0/zip-release@0.7.6 with: - directory: /toZip # File to add to the archive + directory: ./toZip # File to add to the archive path: ./* Filename: FERS.zip # The name of the archive file @@ -62,6 +69,6 @@ jobs: uses: softprops/action-gh-release@v1 with: files: | - build/toZip/FERS.zip + ./toZip/FERS.zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}