generated from Chaste/template_project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cfec4cb
commit 876bc69
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |