Skip to content

Commit

Permalink
organizing actions
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Oct 12, 2023
1 parent 88d6b5b commit f9f89ea
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 154 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docker_and_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Docker and Coverage

on: [push, pull_request]

jobs:
docker-build-and-test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile
- Dockerfile.coverage
- Dockerfile.llvm
- Dockerfile.memcheck
- Dockerfile.no_json
- Dockerfile.nvhpc
- Dockerfile.openmp
# - Dockerfile.intel # intel image is too large for GH action
# - Dockerfile.mpi
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Build Docker image
run: docker build -t micm -f docker/${{ matrix.dockerfile }} .

- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

- name: Run coverage tests in container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'

- name: Copy coverage from container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker cp test-container:build/coverage.info .

- name: Upload coverage report
if: matrix.dockerfile == 'Dockerfile.coverage'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
54 changes: 54 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Mac

on: [push, pull_request]

jobs:
xcode_macos_12:
if: github.event_name == 'pull_request'
runs-on: macos-12
strategy:
matrix:
xcode: ['13.1', '14.1']
# all available versions of xcode: https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@v3

- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --parallel 10
- name: Run tests
run: |
cd build
ctest --rerun-failed --output-on-failure . --verbose -j 10
xcode_macos_13:
if: github.event_name == 'pull_request'
runs-on: macos-13
strategy:
matrix:
# all available versions of xcode: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode
xcode: ['14.1', '15.0']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer

steps:
- uses: actions/checkout@v3

- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --parallel 10
- name: Run tests
run: |
cd build
ctest --rerun-failed --output-on-failure . --verbose -j 10
154 changes: 0 additions & 154 deletions .github/workflows/test.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Ubuntu

on: [push, pull_request]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
gcc:
env:
CC: gcc
CXX: g++
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Cmake
run: cmake -S . -B build

- name: Build
run: cmake --build build --parallel 10

- name: Run tests
run: |
cd build
ctest -C Debug --rerun-failed --output-on-failure . --verbose
clang:
env:
CC: clang
CXX: clang++
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Run Cmake
run: cmake -S . -B build

- name: Build
run: cmake --build build --parallel 10

- name: Run tests
run: |
cd build
ctest -C Debug --rerun-failed --output-on-failure . --verbose
Loading

0 comments on commit f9f89ea

Please sign in to comment.