forked from NCAR/musica
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.74 KB
/
fetch_content_integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: FetchContentIntegration
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
docker-build-and-test:
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile.fortran-intel
- Dockerfile.fortran-gcc.integration
- Dockerfile.fortran-nvhpc
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- name: Build Docker image
run: docker build -t musica --build-arg MUSICA_GIT_TAG=${BRANCH_NAME} -f docker/${{ matrix.dockerfile }} .
- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
run: docker run --name test-container -t musica 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 musica 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