forked from WasmEdge/WasmEdge
-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (97 loc) · 3.1 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
name: Scan WasmEdge with IWYU on Linux and macOS
concurrency:
group: IWYU-scan-${{ github.head_ref }}
cancel-in-progress: true
on:
push:
branches:
- master
paths-ignore:
- 'docs/**'
- 'bindings/**'
- 'rpm/**'
- '**/*.md'
pull_request:
branches:
- master
- 'proposal/**'
paths-ignore:
- 'docs/**'
- 'bindings/**'
- 'rpm/**'
- '**/*.md'
jobs:
get_version_v2:
name: Retrieve version information
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prep.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get version
id: prep
run: |
# Retrieve annotated tags. Details: https://github.com/actions/checkout/issues/290
git fetch --tags --force
echo ::set-output name=version::$(git describe --match "[0-9].[0-9]*" --tag)
build_fedora:
name: Fedora 35
needs: get_version_v2
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install requirments
run: |
dnf update -y
dnf install -y cmake ninja-build boost llvm llvm-devel lld-devel clang git file rpm-build dpkg-dev clang-devel
curl -L -O https://github.com/include-what-you-use/include-what-you-use/archive/refs/tags/0.18.zip
unzip 0.18.zip
mkdir build && cd build
cmake -G "Unix Makefiles" ../include-what-you-use-0.18
make -j
make install
cd ..
- uses: actions/checkout@v2
with:
fetch-depth: 0
- 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_v2
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build and scan WasmEdge with IWYU
run: |
brew install llvm ninja boost cmake
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
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.17.zip
unzip 0.17.zip
mkdir build && cd build
cmake -G "Unix Makefiles" ../include-what-you-use-0.17
make -j install
cd ../WasmEdge/WasmEdge
cmake -Bbuild -GNinja -DWASMEDGE_BUILD_TESTS=ON -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=include-what-you-use .
cmake -Bbuild -GNinja -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_BUILD_PACKAGE="TGZ" .
cmake --build build > iwyu_macos.log
- uses: actions/upload-artifact@v3
with:
name: iwyu_macOS.log
path: iwyu_macOS.log