-
Notifications
You must be signed in to change notification settings - Fork 7
174 lines (146 loc) · 3.65 KB
/
build-test.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: Build-and-Test
run-name: Build and Test on ${{ github.sha }}
on:
push:
branches:
- master
paths:
- 'proto/**'
- 'servers/**'
- 'utils/**'
- 'xclip/**'
- 'xscreenshot/**'
- 'res/**'
- 'tests/**'
- '*.c'
- '*.h'
- 'Makefile'
- 'docker/*'
- 'html/**'
- '.github/workflows/build-test.yml'
pull_request:
branches:
- master
workflow_call: null
jobs:
Style-Check:
uses: ./.github/workflows/check-style.yml
with:
trigger: "${{ github.event_name }}"
permissions:
contents: write
pull-requests: write
Build-and-Test-on-Linux:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: Style-Check
strategy:
matrix:
distro:
- ubuntu
- fedora
- arch
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: docker build -t clipshare -f "docker/Dockerfile.${{matrix.distro}}" .
- name: Test
run: docker run clipshare
Build-and-Test-on-Windows:
runs-on: windows-latest
timeout-minutes: 10
needs: Style-Check
defaults:
run:
shell: msys2 {0}
steps:
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-openssl
mingw-w64-x86_64-libpng
mingw-w64-x86_64-libunistring
mingw-w64-x86_64-python
findutils
diffutils
openbsd-netcat
sed
- name: Setup make
run: ln -s /mingw64/bin/mingw32-make.exe /mingw64/bin/make.exe
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: |
make
make no_ssl
- name: Test
run: make test
Build-and-Test-on-macOS:
timeout-minutes: 10
needs: Style-Check
strategy:
matrix:
os:
- macos-latest
- macos-13
runs-on: ${{ matrix.os }}
steps:
- name: Install build dependencies
run: brew install openssl@3 libpng libunistring
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Build
run: |
make
make no_ssl
- name: Install test dependencies
run: |
brew install coreutils gnu-sed
echo "$(brew --prefix coreutils)"'/libexec/gnubin' >> $GITHUB_PATH
echo "$(brew --prefix gnu-sed)"'/libexec/gnubin' >> $GITHUB_PATH
- name: Test
run: |
export TERM=xterm-256color
make test
CodeQL_Analyze:
runs-on: ubuntu-latest
timeout-minutes: 30
needs:
- Build-and-Test-on-Linux
- Build-and-Test-on-macOS
permissions:
security-events: write
steps:
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y apt-transport-https
sudo apt-get install --no-install-recommends -y coreutils gcc make \
libc6-dev libx11-dev libxmu-dev libxcb-randr0-dev libpng-dev libssl-dev libunistring-dev
- name: Check out repository code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'c-cpp'
trap-caching: false
- name: Build using make
run: make
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"