-
Notifications
You must be signed in to change notification settings - Fork 58
77 lines (72 loc) · 2.42 KB
/
test_ocean_linux_helper.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
name: Test Ocean on Linux (static) [Helper]
on:
workflow_call:
env:
OCEAN_LINK_TYPE: static
OCEAN_BUILD_PATH: ${{ github.workspace }}/ocean_build
OCEAN_INSTALL_PATH: ${{ github.workspace }}/ocean_install
jobs:
build-test-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.post.outputs.matrix }}
env:
config_path: ./.github/workflows/test_config.json
matrix_path: ./matrix.json
steps:
- uses: actions/checkout@v4
- name: Use full matrix
if: ${{ !github.event.pull_request }}
id: full
run: cp $config_path $matrix_path
- name: Filter tests by path
if: ${{ !!github.event.pull_request }}
id: filter
uses: ./.github/actions/filter
with:
input_path: ${{ env.config_path }}
output_path: ${{ env.matrix_path }}
- name: Output matrix
id: post
run: |
{
echo 'matrix<<EOF'
jq '[.[] | del(.paths)]' $matrix_path
echo EOF
} >> $GITHUB_OUTPUT
run-tests:
name: "${{ matrix.suite.id }} (${{ matrix.build_config.capitalcase }})"
runs-on: ubuntu-latest
needs: build-test-matrix
if: ${{ needs.build-test-matrix.outputs.matrix != '[]'}}
timeout-minutes: 60
strategy:
fail-fast: ${{ !!github.event.pull_request }}
matrix:
suite: ${{ fromJSON(needs.build-test-matrix.outputs.matrix) }}
build_config:
- capitalcase: Debug
lowercase: debug
- capitalcase: Release
lowercase: release
steps:
- uses: actions/checkout@v4
- name: Restore cached build artifacts
id: restore-build
uses: actions/cache/restore@v4
with:
path: ${{ env.OCEAN_BUILD_PATH }}
key: ocean-build-${{ matrix.build_config.lowercase }}-${{ github.sha }}
fail-on-cache-miss: true
- name: Run tests
run: |
mkdir -p $INSTALL_PATH/bin
cd $TEST_PATH
if !(ctest $CTEST_ARGS); then
echo "::warning::Re-running failed tests"
ctest $CTEST_ARGS --rerun-failed
fi
env:
INSTALL_PATH: ${{ env.OCEAN_INSTALL_PATH }}/linux_static_${{ matrix.build_config.capitalcase }}
TEST_PATH: ${{ env.OCEAN_BUILD_PATH }}/linux_static_${{ matrix.build_config.capitalcase }}/${{ matrix.suite.test-directory }}
CTEST_ARGS: ${{ matrix.suite.ctest-args }}