Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf committed Feb 28, 2024
1 parent ec9b12f commit 77afded
Showing 1 changed file with 76 additions and 42 deletions.
118 changes: 76 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,79 @@ jobs:
exclude: '.'
extensions: 'h,cpp'
clangFormatVersion: 16
# build:
# runs-on: ${{matrix.os}}
# strategy:
# matrix:
# #os: [ubuntu-latest, macos-latest]
# os: [ ubuntu-latest ]
# build_type: [Release, Debug]
# include:
# # - os: macos-latest
# # build_deps: brew install open-mpi && brew link gcc
# - os: ubuntu-latest
# build_deps: sudo apt-get install mpich libmpich-dev
# name: ${{matrix.os}} - ${{matrix.build_type}}
# steps:
# - uses: actions/checkout@v2
# - name: Install dependencies
# run: ${{matrix.build_deps}}
# - name: Configure and build
# run: |
# cmake -Bbuild -DCMAKE_Fortran_COMPILER=$(which mpif90) .
# cmake --build build -- -j $(nproc)

# analyze:
# name: CodeQL analysis
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2

# - name: Install dependencies
# run: sudo apt-get install mpich libmpich-dev

# - name: Initialize CodeQL
# uses: github/codeql-action/init@v1
# with:
# languages: cpp

# - name: Configure and build
# uses: github/codeql-action/autobuild@v1

# - name: Analyze
# uses: github/codeql-action/analyze@v1
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}')

0 comments on commit 77afded

Please sign in to comment.