forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (114 loc) · 3.5 KB
/
IWYU_scan.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
name: IWYU checker
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
paths:
- ".github/workflows/IWYU_scan.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
pull_request:
branches:
- master
- 'proposal/**'
paths:
- ".github/workflows/IWYU_scan.yml"
- "include/**"
- "lib/**"
- "plugins/**"
- "test/**"
- "thirdparty/**"
- "tools/**"
- "CMakeLists.txt"
jobs:
get_version:
name: Retrieve version information
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git fetch --tags --force
git config --global --add safe.directory $(pwd)
echo "version=$(git describe --match '[0-9].[0-9]*' --tag)" >> $GITHUB_OUTPUT
build_fedora:
name: Fedora latest
needs: get_version
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install requirements
run: |
dnf update -y
dnf install -y cmake ninja-build llvm llvm-devel lld-devel clang git file rpm-build dpkg-dev clang-devel spdlog-devel
curl -L -O https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.20.zip
unzip 0.20.zip
mkdir build && cd build
cmake -G "Unix Makefiles" ../include-what-you-use-0.20
make -j
make install
cd ..
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Build and scan WasmEdge with IWYU
run: |
cmake -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Debug -DWASMEDGE_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use .
cmake --build build > iwyu_fedora.log
- uses: actions/upload-artifact@v3
with:
name: iwyu_fedora.log
path: iwyu_fedora.log
build_macos:
name: macOS
runs-on: macos-latest
needs: get_version
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure git safe directory
run: |
git config --global --add safe.directory $(pwd)
- name: Build and scan WasmEdge with IWYU
shell: bash
run: |
brew install llvm ninja cmake
export LLVM_DIR="/usr/local/opt/llvm/lib/cmake"
export Clang_DIR="/usr/local/opt/llvm/lib/cmake/clang"
export CC=clang
export CXX=clang++
cd ../../
curl -L -O https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.20.zip
unzip 0.20.zip
mkdir build && cd build
cmake -G "Unix Makefiles" ../include-what-you-use-0.20
make -j install
cd ../WasmEdge/WasmEdge
cmake -Bbuild -GNinja -DWASMEDGE_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use -DWASMEDGE_BUILD_PACKAGE="TGZ" .
cmake --build build > iwyu_macos.log
- uses: actions/upload-artifact@v3
with:
name: iwyu_macOS.log
path: iwyu_macOS.log