-
Notifications
You must be signed in to change notification settings - Fork 774
106 lines (91 loc) · 3.61 KB
/
documentation-tests.yaml
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
name: Documentation build and test
on:
workflow_dispatch:
inputs:
optional_documentation_branch:
description: 'Optional Documentation branch name'
required: false
type: string
push:
branches:
- 'master'
paths-ignore:
- '**.md'
- '**.txt'
- '!**/CMakeLists.txt'
pull_request:
branches:
- 'master'
paths-ignore:
- '**.md'
- '**.txt'
- '!**/CMakeLists.txt'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
ACTION_BRANCH_NAME: ${{ github.head_ref }}
jobs:
ubuntu-build-and-test-documentation:
name: Documentation build and test
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'no-test') ||
contains(github.event.pull_request.labels.*.name, 'skip-ci')) }}
runs-on: ubuntu-22.04
steps:
- name: Sync eProsima/Fast-DDS repository
uses: actions/checkout@v3
with:
path: src/fastrtps
submodules: true
- name: Install Fast DDS packages
uses: ./src/fastrtps/.github/actions/install-apt-packages
- name: Install documentation packages
uses: ./src/fastrtps/.github/actions/install-apt-packages-documentation
- name: Download FastDDS dependencies
run: |
pip3 install vcstool
vcs import --skip-existing src < ./src/fastrtps/fastrtps.repos
- name: Determine the Fast DDS Documentation branch to be used
run: |
TEMP_BRANCH=${{ inputs.optional_documentation_branch }}
DOC_REPO=https://github.com/eProsima/fast-dds-docs.git
RESPONSE_CODE=$(git ls-remote --heads $DOC_REPO $TEMP_BRANCH | wc -l)
if [[ -z "$TEMP_BRANCH" || ${RESPONSE_CODE} == "0" ]]
then
TEMP_BRANCH=${{ github.head_ref }}
echo "$given '${{ inputs.optional_documentation_branch }}' branch DOES NOT exist, using head '${{ github.head_ref }}'"
RESPONSE_CODE=$(git ls-remote --heads $DOC_REPO $TEMP_BRANCH | wc -l)
if [[ ${RESPONSE_CODE} == "0" ]]
then
TEMP_BRANCH=${{ github.base_ref }}
echo "head '${{ github.head_ref }}' branch DOES NOT exist, using base '${{ github.base_ref }}'"
RESPONSE_CODE=$(git ls-remote --heads $DOC_REPO $TEMP_BRANCH | wc -l)
if [[ ${RESPONSE_CODE} == "0" ]]
then
echo "ACTION_BRANCH_NAME=master" >> $GITHUB_ENV
echo "base '${{ github.base_ref }}' branch DOES NOT exist, using 'MASTER'"
else
echo "ACTION_BRANCH_NAME=${{ github.base_ref }}" >> $GITHUB_ENV
fi
else
echo "ACTION_BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
fi
else
echo "ACTION_BRANCH_NAME=${{ inputs.optional_documentation_branch }}" >> $GITHUB_ENV
echo "using given '${{ inputs.optional_documentation_branch }}' branch"
fi
- name: Download FastDDS documentation repo
uses: actions/checkout@v3
with:
repository: eProsima/Fast-DDS-docs
path: src/fastdds-docs
ref: ${{ env.ACTION_BRANCH_NAME }}
- name: Install required python packages
run: |
pip3 install -r src/fastdds-docs/docs/requirements.txt
- name: Build documentation
run: |
colcon build --event-handlers=console_direct+ --metas
- name: Run documentation tests
run: |
colcon test --event-handlers=console_direct+ --packages-select fastdds-docs --return-code-on-test-failure