-
Notifications
You must be signed in to change notification settings - Fork 62
140 lines (122 loc) · 4.02 KB
/
build.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
name: 'DwarFS CI Build'
on:
workflow_dispatch:
push:
branches:
- main
- 'mhx/**'
tags:
- v*
permissions:
contents: read
jobs:
windows:
runs-on:
- self-hosted
- Windows
strategy:
matrix:
arch:
- X64
build_mode:
- Release
- Debug
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: '0'
ref: ${{ github.ref }}
- name: Set MSVC Dev Environment
uses: ilammy/msvc-dev-cmd@v1
- name: Configure Build
shell: cmd
run: |
cmake -B${{ runner.temp }}\build -S${{ runner.workspace }}\dwarfs -GNinja -DCMAKE_MAKE_PROGRAM=C:\bin\ninja.exe -DCMAKE_BUILD_TYPE=${{ matrix.build_mode }} -DWITH_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DVCPKG_INSTALLED_DIR=${{ runner.workspace }}\vcpkg-install-dwarfs -DDWARFS_ARTIFACTS_DIR=Z:\artifacts\dwarfs
- name: Run Build
shell: cmd
run: |
cmake --build ${{ runner.temp }}\build
- name: Run Test
shell: cmd
run: |
copy "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" ${{ runner.temp }}\build
ctest --test-dir ${{ runner.temp }}\build --output-on-failure -j8
- name: Build Package
shell: cmd
run: |
cmake --build ${{ runner.temp }}\build --target package
- name: Compress Universal Binary
shell: cmd
run: |
cmake --build ${{ runner.temp }}\build --target universal_upx
- name: Copy Artifacts
shell: cmd
run: |
cmake --build ${{ runner.temp }}\build --target copy_artifacts
if: matrix.build_mode == 'Release'
linux:
strategy:
matrix:
arch:
- amd64
- arm64v8
build_type:
- gcc-debug-ninja
- gcc-release-ninja
- oldgcc-debug-make
- clang-release-ninja
- clang-release-ninja-static
- oldclang-debug-make
include:
- arch: amd64
build_type: clang-asan-ninja
- arch: amd64
build_type: clang-tsan-ninja
- arch: amd64
build_type: clang-ubsan-ninja
- arch: amd64
build_type: gcc-debug-noperfmon-ninja
- arch: amd64
build_type: clang-coverage-ninja
runs-on:
- self-hosted
- Linux
- ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: '0'
ref: ${{ github.ref }}
- name: Build Docker Image
run: |
docker build \
-t dwarfs-linux-build \
--build-arg ARCH=${{ matrix.arch }} \
--build-arg SCRIPT=build-linux.sh \
.docker
- name: Run Build (${{ matrix.build_type }})
run: |
docker run --rm \
--cap-add SYS_ADMIN --device /dev/fuse --privileged \
--mount type=bind,source=${GITHUB_WORKSPACE},target=/workspace,readonly \
--mount type=bind,source=${{ runner.temp }},target=/tmp-runner \
--mount type=bind,source=/home/mhx/github-ccache,target=/ccache \
--mount type=bind,source=/mnt/opensource/artifacts/dwarfs,target=/artifacts \
--env BUILD_TYPE=${{ matrix.build_type }} \
--env BUILD_ARCH=${{ matrix.arch }} \
--env GITHUB_REF_NAME \
--env GITHUB_REF_TYPE \
--env GITHUB_RUN_ID \
--env GITHUB_RUN_NUMBER \
--env GITHUB_RUN_ATTEMPT \
dwarfs-linux-build
- name: Upload Coverage Data
if: matrix.build_type == 'clang-coverage'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ runner.temp }}/mkdwarfs.txt,${{ runner.temp }}/dwarfs.txt,${{ runner.temp }}/dwarfsck.txt,${{ runner.temp }}/dwarfsextract.txt