-
Notifications
You must be signed in to change notification settings - Fork 561
155 lines (142 loc) · 6.15 KB
/
ci-docs.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# **********************************************************
# Copyright (c) 2020-2023 Google, Inc. All rights reserved.
# **********************************************************
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of Google, Inc. nor the names of its contributors may be
# used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
# Github Actions workflow for building doxygen docs for the web site.
name: ci-docs
on:
# Built weekly: 10pm EST Fridays. A re-build even with no content
# changes updates timestamps on every page, increasing the repo size.
# We thus use manual builds for rare docs changes we want to deploy to
# the website and have automated builds match our weekly package builds.
schedule:
- cron: '0 3 * * FRI'
# Manual trigger using the Actions page.
workflow_dispatch:
inputs:
version:
description: 'Version number for docs (blank for cronbuild)'
required: false
default: ''
build:
description: 'Build number for docs'
required: true
default: '0'
defaults:
run:
shell: bash
jobs:
###########################################################################
# Docs deployment, building on Linux.
docs:
# We use a more recent Ubuntu for better markdown support.
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Fetch Sources
run: |
git fetch --no-tags --depth=1 origin master
# Include Dr. Memory in packages.
# We do shallow clones and assume DrM will update its DR at least once
# every 250 DR commits.
git clone --depth=2 https://github.com/DynamoRIO/drmemory.git drmemory
cd drmemory && git submodule update --init --recursive --depth 250 && cd ..
# Install needed packages.
- name: Create Build Environment
run: |
sudo apt-get update
sudo apt-get -y install doxygen vera++ cmake zlib1g-dev libsnappy-dev \
liblz4-dev libunwind-dev
- name: Get Version
id: version
# XXX: For now we duplicate this version number here with CMakeLists.txt.
# We should find a way to share (xref i#1565).
# We support setting the version and build for manual builds.
# We only use a non-zero build # when making multiple manual builds in one day.
run: |
if test -z "${{ github.event.inputs.version }}"; then
export VERSION_NUMBER=10.0.$((`git log -n 1 --format=%ct` / (60*60*24)))
else
export VERSION_NUMBER=${{ github.event.inputs.version }}
fi
if [ "${{ github.event.inputs.build }}" -ne 0 ]; then
export VERSION_NUMBER="${VERSION_NUMBER}-${{ github.event.inputs.build }}"
fi
echo "::set-output name=version_number::${VERSION_NUMBER}"
- name: Build Docs
working-directory: ${{ github.workspace }}
run: ./suite/runsuite_wrapper.pl automated_ci 64_only
env:
CI_TARGET: package
VERSION_NUMBER: ${{ steps.version.outputs.version_number }}
DEPLOY_DOCS: yes
DYNAMORIO_CROSS_AARCHXX_LINUX_ONLY: no
CI_TRIGGER: ${{ github.event_name }}
CI_BRANCH: ${{ github.ref }}
- name: Check Out Web
uses: actions/checkout@v2
with:
repository: DynamoRIO/dynamorio.github.io
token: ${{ secrets.DOCS_TOKEN }}
path: dynamorio.github.io
- name: Deploy Embedded Docs
run: |
rsync -av --delete html_embed/ dynamorio.github.io/docs/
cd dynamorio.github.io
git config --local user.name "cronbuild"
git config --local user.email "[email protected]"
git add -A
git commit -m "Snapshot for cronbuild-${{ steps.version.outputs.version_number }}"
git push
env:
# We need a personal access token for write access to another repo.
GITHUB_TOKEN: ${{ secrets.DOCS_TOKEN }}
- name: Send failure mail to dynamorio-devs
if: failure() && github.ref == 'refs/heads/master'
uses: dawidd6/action-send-mail@v2
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_USERNAME}}
password: ${{secrets.DYNAMORIO_NOTIFICATION_EMAIL_PASSWORD}}
subject: |
[${{github.repository}}] ${{github.workflow}} FAILED
on ${{github.event_name}} at ${{github.ref}}
body: |
Github Actions CI workflow run FAILED!
Workflow: ${{github.workflow}}/docs
Repository: ${{github.repository}}
Branch ref: ${{github.ref}}
SHA: ${{github.sha}}
Triggering actor: ${{github.actor}}
Triggering event: ${{github.event_name}}
Run Id: ${{github.run_id}}
See more details on github.com/DynamoRIO/dynamorio/actions/runs/${{github.run_id}}
from: Github Action package jobs