-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (113 loc) · 3.84 KB
/
Copy pathbasic.yml
File metadata and controls
138 lines (113 loc) · 3.84 KB
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
name: Basic
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
deploy_documentation:
description: Deploy documentation
required: false
type: boolean
default: false
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Check if oneAPI is already installed
id: check-oneapi
run: |
if [ -f /opt/intel/oneapi/setvars.sh ]; then
echo "installed=true" >> $GITHUB_OUTPUT
else
echo "installed=false" >> $GITHUB_OUTPUT
fi
- name: Setup oneAPI
if: steps.check-oneapi.outputs.installed != 'true'
run: |
installer="intel-oneapi-toolkit-2026.1.0.192_offline.sh"
checksum="9d969de9cafbb698bf50f088c4b5174b50fc816f504049e685d6f6d198e10dbc17ef2cd4cfb0bc2b3d2179644a8d77d1"
curl --fail --location --retry 3 --silent --show-error --output "$installer" \
"https://registrationcenter-download.intel.com/akdlm/IRC_NAS/33cb2a22-ddf1-4aa9-8d68-1f5a118acaf2/intel-oneapi-toolkit-2026.1.0.192_offline.sh"
echo "$checksum $installer" | sha384sum --check
sudo sh "./$installer" -a --silent --cli --eula accept
- name: Configure oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
# copy envs to github
printenv | grep -E '^(PATH|LD_LIBRARY_PATH|LIBRARY_PATH|CPATH|C_INCLUDE_PATH|CPLUS_INCLUDE_PATH)=' >> $GITHUB_ENV
icx --version
sycl-ls --verbose
- name: Check formatting
run: cargo fmt --all -- --check
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install --yes clang-format
- name: Check C++ formatting
run: |
git ls-files -z -- ':(glob)**/*.cpp' ':(glob)**/*.hpp' ':(glob)**/*.h' \
| xargs -0 --no-run-if-empty clang-format --dry-run --Werror
- name: Build
run: cargo build --verbose
- name: Run workspace tests
run: cargo test --workspace --verbose
- name: Run examples
run: |
for example_path in oneapi-rs/examples/*.rs; do
example="$(basename "$example_path" .rs)"
cargo run -p oneapi-rs --example "$example" --verbose
done
- name: Generate documentation
run: |
cargo doc -p oneapi-rs --no-deps --verbose
cat > target/doc/index.html <<'HTML'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=oneapi_rs/">
<title>oneapi-rs documentation</title>
</head>
<body>
<p><a href="oneapi_rs/">oneapi-rs documentation</a></p>
</body>
</html>
HTML
- name: Upload documentation artifact
uses: actions/upload-artifact@v6
with:
name: documentation
path: target/doc
deploy-documentation:
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.deploy_documentation == 'true')
needs: build-and-test
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download documentation artifact
uses: actions/download-artifact@v7
with:
name: documentation
path: target/doc
- name: Configure GitHub Pages
uses: actions/configure-pages@v6
- name: Upload documentation to GitHub Pages
uses: actions/upload-pages-artifact@v5
with:
path: target/doc
- name: Deploy documentation to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5