Hook up CI #2
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: TIOGA CI | |
on: | |
push: | |
branches: | |
- exawind | |
pull_request: | |
branches: | |
- exawind | |
concurrency: | |
group: ${{github.ref}}-${{github.head_ref}}-ci | |
cancel-in-progress: true | |
jobs: | |
Formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
- name: Check formatting | |
uses: DoozyX/[email protected] | |
with: | |
source: './src' | |
exclude: '.' | |
extensions: 'h,cpp' | |
clangFormatVersion: 16 | |
CPU: | |
#needs: Formatting | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
build_type: [Release, Debug] | |
include: | |
- os: macos-latest | |
install_deps: brew install mpich ccache | |
comp: llvm | |
procs: $(sysctl -n hw.ncpu) | |
ccache_cache: /Users/runner/Library/Caches/ccache | |
ccache_size: 50M | |
- os: ubuntu-latest | |
install_deps: sudo apt-get install -y mpich libmpich-dev | |
comp: gnu | |
procs: $(nproc) | |
ccache_cache: ~/.cache/ccache | |
ccache_size: 50M | |
steps: | |
- name: Clone | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Dependencies | |
run: ${{matrix.install_deps}} | |
- name: Setup | |
run: | | |
echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV | |
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV | |
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV | |
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV | |
echo "CCACHE_MAXSIZE=${{matrix.ccache_size}}" >> $GITHUB_ENV | |
- name: Install Ccache | |
run: | | |
if [ "${RUNNER_OS}" != "macOS" ]; then | |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz | |
tar xvf ccache-4.8-linux-x86_64.tar.xz | |
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/ | |
fi | |
- name: Set Up Ccache | |
uses: actions/cache@v4 | |
with: | |
path: ${{matrix.ccache_cache}} | |
key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-git-${{github.sha}} | |
restore-keys: | | |
ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-git- | |
- name: Configure | |
run: | | |
cmake -B ${{runner.workspace}}/build-ci-${{matrix.build_type}} \ | |
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-${{matrix.build_type}} \ | |
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \ | |
${{github.workspace}} | |
- name: Build | |
run: | | |
echo "::add-matcher::.github/problem-matchers/gcc.json" | |
ccache -z | |
set -eu -o pipefail | |
cmake --build ${{runner.workspace}}/build-ci-${{matrix.build_type}} --parallel ${{env.NPROCS}} 2>&1 | \ | |
tee -a ${{runner.workspace}}/build-ci-${{matrix.build_type}}/build-output.txt | |
- name: Ccache Report | |
run: | | |
ccache -s | |
ls ${{matrix.ccache_cache}} | |
du -hs ${{matrix.ccache_cache}} | |
- name: Report | |
working-directory: ${{runner.workspace}}/build-ci-${{matrix.build_type}} | |
run: | | |
echo "::add-matcher::.github/problem-matchers/gcc.json" | |
egrep "warning:|error:" build-output.txt | egrep -v "submods" \ | |
| egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \ | |
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > build-output-warnings.txt | |
cat build-output-warnings.txt | |
exit $(tail -n 1 build-output-warnings.txt | awk '{print $2}') |