-
Notifications
You must be signed in to change notification settings - Fork 17
50 lines (42 loc) · 1.47 KB
/
CPU_Beltrami_build_run.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
name: Samurai CPU test with Beltrami
on:
workflow_dispatch:
branches: [ "main" ]
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
docker-build-and-test:
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile
- Dockerfile.coverage
steps:
- name: Checkout code from a pull request or push
uses: actions/checkout@v3
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
- name: Build Docker image
run: docker build -f docker/${{ matrix.dockerfile }} -t samurai .
- name: Running the Docker image for Beltrami case
# only run this if we are not running codecoverage tests
if: matrix.dockerfile != 'Dockerfile.coverage'
run: docker run --name test-container -t samurai
- name: Run coverage tests in container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker run --name test-container -t samurai make coverage
- name: Copy coverage from container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker cp test-container:/app/samurai/build/coverage.info .
- name: Upload coverage reports to Codecov
if: matrix.dockerfile == 'Dockerfile.coverage'
uses: codecov/codecov-action@v4
with:
files: coverage.info
token: ${{ secrets.CODECOV_TOKEN }}