Transition Azure Pipelines to Github Actions #21
Workflow file for this run
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
name: Build and Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
# TODO USE vars context FOR STORING COMPILER_IMAGE | |
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#vars-context :) | |
# Cancel previous jobs if an update has been made to the pull request | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
max-parallel: 4 # Limit the amount of jobs one user can run in parallel to share resources fairly | |
matrix: | |
build_type: [ Debug, Release ] | |
config: | |
- host_config: gcc@12.3.0_cuda.cmake | |
compiler_image: seracllnl/tpls:cuda-12_08-15-24_21h-49m | |
cmake_opts: "-DBUILD_SHARED_LIBS=ON -DENABLE_WARNINGS_AS_ERRORS=OFF" | |
build_src_opts: "--skip-install --skip-tests" | |
- host_config: clang@14.0.0.cmake | |
compiler_image: seracllnl/tpls:clang-14_08-15-24_21h-49m | |
cmake_opts: "-DBUILD_SHARED_LIBS=ON" | |
- host_config: gcc@13.1.0.cmake | |
compiler_image: seracllnl/tpls:gcc-13_08-15-24_21h-49m | |
cmake_opts: "-DBUILD_SHARED_LIBS=ON" | |
include: | |
- build_type: Debug | |
config: | |
host_config: clang@14.0.0.cmake | |
compiler_image: seracllnl/tpls:clang-14_08-15-24_21h-49m | |
cmake_opts: "-DSERAC_ENABLE_CODEVELOP=ON" | |
container: | |
image: ${{ matrix.config.compiler_image }} | |
volumes: | |
- /home/serac/serac | |
steps: | |
- name: Checkout Serac | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Print Matrix Variables | |
run: | | |
echo "build_src_opts ${{ matrix.config.build_src_opts }}" | |
echo "build_type ${{ matrix.build_type }}" | |
echo "cmake_opts ${{ matrix.config.cmake_opts }}" | |
echo "compiler_image ${{ matrix.config.compiler_image }}" | |
echo "host_config ${{ matrix.config.host_config }}" | |
- name: Build and Test ${{ matrix.config.host_config }} ${{ matrix.build_type }} | |
timeout-minutes: 30 | |
run: | | |
./scripts/llnl/build_src.py ${{ matrix.config.build_src_opts }} \ | |
--verbose \ | |
--host-config ${{ matrix.config.host_config }} \ | |
--extra-cmake-options "${{ matrix.config.cmake_opts }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}" \ | |
--jobs 4 | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Test Results ${{ matrix.config.host_config }} ${{ matrix.build_type }} ${{ matrix.config.cmake_opts }} | |
path: "**/Test.xml" | |
if-no-files-found: ignore | |
check_code: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
check_type: [coverage, docs, style, header] | |
container: | |
image: seracllnl/tpls:clang-14_08-15-24_21h-49m | |
volumes: | |
- /home/serac/serac | |
env: | |
CHECK_TYPE: ${{ matrix.check_type }} | |
HOST_CONFIG: clang@14.0.0.cmake | |
steps: | |
- name: Checkout Serac | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Check ${{ matrix.check_type }} | |
run: ./scripts/github-actions/linux-check.sh |