-
Notifications
You must be signed in to change notification settings - Fork 110
87 lines (82 loc) · 2.69 KB
/
pr.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
# SPDX-FileCopyrightText: 2019-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
name: "PR Tests"
permissions: read-all
on:
push:
branches:
- 'main'
pull_request:
jobs:
checks:
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-latest' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: '3.10'
cache: 'pip'
- name: Checks
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
build:
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-latest' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Install ubuntu prerequisites
run: |
sudo apt update -qq
xargs -a ubuntu-packages.txt sudo apt install -qq
curl -s https://www.doxygen.nl/files/doxygen-1.9.6.linux.bin.tar.gz -o /tmp/dox.tgz
sudo tar zxf /tmp/dox.tgz -C /usr/local
sudo ln -s /usr/local/doxygen*/bin/* /usr/bin
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c
with:
python-version: '3.10'
cache: 'pip'
- name: Install python prerequisites
run: pip install --quiet -r requirements.txt
- name: Build html
env:
ONEAPI_DRAFT: true
run: |
python scripts/oneapi.py -W html
- name: Build pdf
env:
ONEAPI_DRAFT: true
run: |
python scripts/oneapi.py -W latexpdf
- name: Build website
run: |
mkdir -p site/spec
touch site/.nojekyll
cp -r build/html/* site/spec
cp build/latex/*.pdf site/spec
- name: Archive site
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: site
path: site
publish_site:
needs: [checks, build]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-latest' || 'ubuntu-latest' }}
steps:
- name: Checkout gh-pages
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
ref: gh-pages
path: gh-pages
- name: Retrieve site
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935
with:
name: site
path: gh-pages
- name: Publish to github pages
run: |
cd gh-pages
git config user.name github-actions
git config user.email [email protected]
git add .
git commit --reset-author --amend -m "Update from github actions"
git push --force origin gh-pages