generated from DARMA-tasking/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (102 loc) · 3.86 KB
/
build-and-test-ubuntu.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Build and Test (ubuntu)
# Trigger the workflow on push or pull request
on:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize, converted_to_draft, ready_for_review]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
host: [
{
base: ubuntu-22.04,
compiler: { cc: gcc-11 },
python: ['3.8', '3.9', '3.10', '3.11', '3.12'],
vtk: '9.2.2',
image: ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.all
},
{
base: ubuntu-22.04,
compiler: { cc: clang-11 },
python: ['3.8', '3.9', '3.10', '3.11', '3.12'],
vtk: '9.2.2',
image: ubuntu_22.04-clang_11-vtk_9.2.2-py_3.all
},
{
base: ubuntu-22.04,
compiler: { cc: gcc-12 },
python: ['3.8', '3.9', '3.10', '3.11', '3.12'],
vtk: '9.3.0',
image: ubuntu_22.04-gcc_12-vtk_9.3.0-py_3.all
},
{
base: ubuntu-24.04,
compiler: { cc: gcc-13 },
python: ['3.8', '3.9', '3.10', '3.11', '3.12'],
vtk: '9.3.1',
image: ubuntu_24.04-gcc_13-vtk_9.3.1-py_3.all
}
]
env:
OUTPUT_DIR: '/tmp/artifacts'
VT_TV_TESTS_ENABLED: 'ON'
VT_TV_COVERAGE_ENABLED: ${{ matrix.host.image == 'ubuntu_22.04-gcc_12-vtk_9.3.0-py_3.all' && 'ON' || 'OFF' }} # Coverage only with main test image
DOCKER_REPOSITORY: lifflander1/vt
DOCKER_TAG: ~
name: vt-tv build and test (${{ matrix.host.base }}, ${{ matrix.host.compiler.cc }}, vtk-${{ matrix.host.vtk }}, py[${{ join(matrix.host.python, ', ') }}])
steps:
- uses: actions/checkout@v4
- name: CI Variables
id: vars
run: echo "DOCKER_TAG=$(echo ${{ github.ref }} | cut -d'/' -f3- | sed 's/[^a-z0-9_-]/__/gi')" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Inspect Builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
echo "DOCKER_TAG: ${{ env.DOCKER_TAG }}"
- name: Build the Docker Image; build and test vt-tv
id: docker_build
continue-on-error: false
uses: docker/build-push-action@v6
with:
push: false
# tags: ${{ env.DOCKER_TAG }}
context: .
file: ./ci/docker/build-and-test-ubuntu.dockerfile
build-args: |
BASE_IMAGE=${{ env.DOCKER_REPOSITORY }}:${{ matrix.host.image }}
VT_TV_TESTS_ENABLED=${{ env.VT_TV_TESTS_ENABLED }}
VT_TV_COVERAGE_ENABLED=${{ env.VT_TV_COVERAGE_ENABLED }}
outputs: type=local,dest=${{ env.OUTPUT_DIR }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: vt-tv-Artifacts-${{ matrix.host.image }}
path: ${{ env.OUTPUT_DIR }}
- name: Unit tests
if: ${{ env.VT_TV_TESTS_ENABLED == 'ON' }}
uses: phoenix-actions/test-reporting@v15
with:
name: Tests report
path: ${{ env.OUTPUT_DIR }}/tmp/artifacts/junit-report.xml
reporter: java-junit
output-to: step-summary
- name: Coverage summary
if: ${{ (success() || failure()) && env.VT_TV_COVERAGE_ENABLED == 'ON' }}
run: |
echo '## Coverage' >> $GITHUB_STEP_SUMMARY
echo '```shell' >> $GITHUB_STEP_SUMMARY
cat ${{ env.OUTPUT_DIR }}/tmp/artifacts/lcov-list-report.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY