-
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (78 loc) · 2.47 KB
/
test-and-build.yaml
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
on: push
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Setup CMake
uses: jwlawson/[email protected]
with:
cmake-version: 3.22.x
- name: Checkout code
uses: actions/checkout@v3
- name: Install gtest and gcovr
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get -qq update && sudo apt-get install -qq -y libgtest-dev gcovr
- name: Run tests
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Debug .
make -C build pmalloc_test
# this needs privileges for reading the physical address and modifying
# the amount of huge pages allocated by the system
sudo make -C build coverage
- name: Analyze test results
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Test results
path: build/junit.xml
reporter: jest-junit
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
with:
files: build/coverage.xml
build:
name: Build packages
runs-on: ubuntu-latest
needs: test
strategy:
matrix:
os:
- name: ubuntu
version: bionic
- name: ubuntu
version: focal
- name: ubuntu
version: jammy
- name: debian
version: bullseye
- name: debian
version: bookworm
- name: debian
version: testing
container:
image: ${{ matrix.os.name }}:${{ matrix.os.version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install build dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: apt-get -qq update && apt-get install -qq -y build-essential cmake file
- name: Build package for ${{ matrix.os.name }} ${{ matrix.os.version }}
run: |
mkdir -p build && cd build && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_SHARED_LIBS=on \
-DCPACK_DEBIAN_PACKAGE_RELEASE=+ci$GITHUB_RUN_ID \
../ && \
make package
- name: Uploading artifacts
uses: actions/upload-artifact@v3
with:
name: pmalloc-${{ matrix.os.name }}-${{ matrix.os.version }}
path: |
build/libpmalloc_*.deb
build/libpmalloc-dev_*.deb
build/libpmalloc-dbgsym*.ddeb