-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (58 loc) · 1.65 KB
/
c-cpp.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
name: C/C++ CI
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ammaraskar/gcc-problem-matcher@master
- name: deps
run: sudo apt install asciidoctor bash-completion
- name: configure
run: cmake -B build
-DCMAKE_CXX_FLAGS="-O2 -pipe -fno-plt -Wall -Wextra"
-DCMAKE_C_FLAGS="-O2 -pipe -fno-plt -Wall -Wextra"
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
- name: build
run: |
export MAKEFLAGS=-j$(nproc)
cmake --build build
- name: deb
run: |
strip --strip-all $(find build -maxdepth 1 -executable -type f)
cmake --build build --target package
- uses: actions/upload-artifact@v3
with:
name: ubuntu_package
path: build/*.deb
arch-linux:
runs-on: ubuntu-latest
container: archlinux:base-devel
steps:
- uses: ammaraskar/gcc-problem-matcher@master
- name: Build user
run: |
USER=ab
useradd "$USER"
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/pacman" >> "/etc/sudoers.d/$USER-no-password"
- run: pacman -Syu --noconfirm git
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: chown --recursive ab ./
- name: makepkg
working-directory: ./pkg/arch
run: |
export MAKEFLAGS=-j$(nproc)
export PKGDEST=./
sudo -Eu ab makepkg -s --noconfirm
- uses: actions/upload-artifact@v3
with:
name: arch_package
path: pkg/arch/*.pkg.tar.*