Skip to content

Make tests more convenient to run #127

Make tests more convenient to run

Make tests more convenient to run #127

Workflow file for this run

name: CI
on:
push:
branches: [ master, v2.x ]
pull_request:
branches: [ master, v2.x ]
schedule:
# Run every Sunday at midnight
- cron: '0 0 * * 0'
defaults:
run:
shell: bash -l {0}
jobs:
build:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
# Oldest supported versions
- name: Linux (CUDA 10.2)
cuda: "10.2.89"
gcc: "8.5.*"
cuda12: false
# Latest supported versions
- name: Linux (CUDA 12.1)
cuda: "12.1.*"
gcc: "11.*"
cuda12: true
steps:
- name: Check out
uses: actions/checkout@v2
- name: Manage disk space
run: |
sudo mkdir -p /opt/empty_dir || true
for d in \
/opt/ghc \
/opt/hostedtoolcache \
/usr/lib/jvm \
/usr/local/.ghcup \
/usr/local/lib/android \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift \
; do
sudo rsync --stats -a --delete /opt/empty_dir/ $d || true
done
sudo apt-get purge -y -f firefox \
google-chrome-stable \
microsoft-edge-stable
sudo apt-get autoremove -y >& /dev/null
sudo apt-get autoclean -y >& /dev/null
sudo docker image prune --all --force
df -h
- name: Install CUDA Toolkit
# CUDA 12 can be installed with mamba
if: ${{ matrix.cuda12 == 'false' }}
uses: Jimver/[email protected]
with:
cuda: ${{ matrix.cuda }}
linux-local-args: '["--toolkit", "--override"]'
- name: Prepare dependencies (CUDA <12)
if: ${{ matrix.cuda12 == 'false'}}
run: |
sed -i -e "/cuda-version/d" \
-e "/cuda-libraries-dev/d" \
-e "/cuda-nvcc/d" \
-e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \
environment.yml
- name: Prepare dependencies (CUDA >=12)
if: ${{ matrix.cuda12 == 'true' }}
run: |
sed -i -e "/cuda-version/c\ - cuda-version ${{ matrix.cuda }}" \
-e "/gxx_linux-64/c\ - gxx_linux-64 ${{ matrix.gcc }}" \
environment.yml
- name: Show dependency file
run: cat environment.yml
- name: Install Mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: false
cache-downloads: true
env:
CONDA_OVERRIDE_CUDA: ${{ matrix.nvcc }}
- name: List environment
run: |
micromamba activate uammd
micromamba list
- name: Configure and compile examples
run: |
micromamba activate uammd
mkdir examples/build && cd examples/build
cmake -DCMAKE_VERBOSE_MAKEFILE=yes ..
make -j3
- name: Configure and compile tests
run: |
micromamba activate uammd
mkdir test/build && cd test/build
cmake -DCMAKE_VERBOSE_MAKEFILE=yes ..
make -j3