Skip to content

Add amdflang builds

Add amdflang builds #1

name: linux-amdflang-cmake
on:
push:
branches:
- master
- main
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
jobs:
linux-tests:

Check failure on line 19 in .github/workflows/linux-amdflang-cmake.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/linux-amdflang-cmake.yaml

Invalid workflow file

You have an error in your yaml syntax on line 19
timeout-minutes: 20
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - ${{ matrix.fcompiler }} - ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
fcompiler: amdflang
ccompiler: amdclang
spack_compiler: rocmcc
spack_os: "ubuntu:22.04"
shell: bash
build_type: debug
memcheck: false
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: rocm-setup
run: |
sudo apt update -y
wget https://repo.radeon.com/amdgpu-install/6.1.1/ubuntu/jammy/amdgpu-install_6.1.60101-1_all.deb
sudo apt install -y ./amdgpu-install_6.1.60101-1_all.deb
sudo amdgpu-install --accept-eula -y --usecase=openmpsdk --no-dkms
- name: Show version information
run: |
export PATH=${PATH}:/opt/rocm/bin
${{ matrix.fcompiler }} --version
${{ matrix.ccompiler }} --version
- name: Set up Spack
uses: spack/setup-spack@v2
- name: Install dependencies in spack environment
run: |
spack -e . mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack compiler find
spack config add packages:all:compiler:[${{ matrix.spack_compiler }}]
spack -e . concretize
spack -e . install --no-check-signature
- name: Build with Cmake
shell: spack-bash {0}
run: |
spack env activate .
mkdir build
cd build
FC=${{ matrix.fcompiler }} CC=${{ matrix.ccompiler }} cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
make VERBOSE=1
- name: Initialize coverage counters
if: ${{ matrix.build_type == 'coverage' }}
run: |
sudo apt-get update -y && sudo apt-get install lcov
lcov --no-external \
--directory /home/runner/work/self \
--zerocounters
- name: Run ctests
run: |
cd build/test
ctest || ctest --rerun-failed --output-on-failure
- name: Create coverage report
if: ${{ matrix.build_type == 'coverage' }}
run: |
lcov --no-external \
--capture \
--directory /home/runner/work/self \
--exclude '*/test/*' \
--output-file /home/runner/work/lcov.info
- name: codecov
if: ${{ matrix.build_type == 'coverage' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: /home/runner/work/lcov.info
flags: ctests
- name: Run memory checks with Valgrind (only Linux and GNU compilers)
if: ${{ matrix.memcheck }}
run: |
sudo apt-get install -y valgrind
for f in $(find ./build/test/ -executable -type f)
do
echo $f
valgrind --undef-value-errors=no --error-exitcode=1 -s $f -A
done
- name: Push packages and update index
run: |
spack -e . mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack -e . buildcache push --base-image ${{ matrix.spack_os }} --update-index local-buildcache
if: ${{ !cancelled() }}