diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml new file mode 100644 index 0000000..c06b0d2 --- /dev/null +++ b/.github/workflows/ubuntu-tests.yml @@ -0,0 +1,98 @@ +name: Ubuntu tests + +on: + workflow_dispatch: + pull_request: + branches: + - '**' + push: + branches: + - main + +jobs: + + build-and-test: + + if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:off') }} + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + include: + - os: "ubuntu-20.04" + codename: "focal" + cc: "gcc" + cxx: "g++" + - os: "ubuntu-22.04" + codename: "jammy" + cc: "gcc" + cxx: "g++" + - os: "ubuntu-22.04" + codename: "jammy" + cc: "icx" + cxx: "icpx" + + env: + CHASTE_TEST_OUTPUT: ${{ github.workspace }}/chaste-test-dir + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + + steps: + - name: checkout Chaste + uses: actions/checkout@v4 + with: + repository: 'Chaste/Chaste' + ref: 'develop' + path: 'Chaste' + + - name: checkout this repo + uses: actions/checkout@v4 + with: + path: 'Chaste/projects/' + + - name: install dependencies + run: | + echo 'deb [signed-by=/usr/share/keyrings/chaste.asc] https://chaste.github.io/ubuntu ${{ matrix.codename }}/' | sudo tee -a /etc/apt/sources.list.d/chaste.list + sudo wget -O /usr/share/keyrings/chaste.asc https://chaste.github.io/chaste.asc + sudo apt update + sudo apt install chaste-dependencies + + - name: Downgrade libexpat1 (native ubuntu-22.04 only) + if: ${{ matrix.os == 'ubuntu-22.04' }} + run: | + if dpkg -l | grep libexpat1-dev | grep 2.4.7-1ubuntu0.3; then + sudo apt-get install -y --allow-downgrades libexpat1=2.4.7-1 libexpat1-dev=2.4.7-1 + fi + + - name: install and set up Intel LLVM compiler + run: | + echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null + sudo apt update + sudo apt install intel-oneapi-compiler-dpcpp-cpp + source /opt/intel/oneapi/setvars.sh + printenv >> $GITHUB_ENV + if: ${{ matrix.cc == 'icx' }} + + - name: compiler version + run: | + ${CXX} --version + + - name: make build and test directories + run: | + mkdir -p chaste-build-dir + mkdir -p ${CHASTE_TEST_OUTPUT} + + - name: cmake configure + run: cmake -DCMAKE_BUILD_TYPE=Release .. + working-directory: chaste-build-dir + + - name: build project + run: cmake --build . --parallel 4 --target project_OpenVT + working-directory: chaste-build-dir + + - name: run project tests + run: ctest -j4 -L project_OpenVT --output-on-failure + working-directory: chaste-build-dir