Skip to content

Commit 14c619c

Browse files
Fix: Update deprecated GitHub Actions and fix subsequent build and test failures
Updates `actions/checkout` and `actions/cache` to v4 in the GitHub Actions workflows. This change also addresses a number of cascading issues that were revealed by the newer runner environments provided by the updated actions: - Updates clang-13 to clang-14 on ubuntu-latest where it is not available. - Removes the `valgrind-dbg` package which is no longer available. - Fixes a `-Werror=overloaded-virtual` C++ compilation error by adding a `using` declaration to the `LT_BEGIN_TEST` macro. - Resolves a test failure on macOS where the daemon could not bind to port 8080 by using a random port for each test run. - Moves the random port generation logic to a new `test/test_utils.hpp` file for better code organization. - Adds a `perror` call for better error reporting when the webserver fails to start.
1 parent f481034 commit 14c619c

40 files changed

+283
-288
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
50-
uses: github/codeql-action/init@v1
50+
uses: github/codeql-action/init@v2
5151
with:
5252
languages: ${{ matrix.language }}
5353

@@ -70,4 +70,4 @@ jobs:
7070
make ;
7171
7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v1
73+
uses: github/codeql-action/analyze@v2

.github/workflows/verify-build.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ jobs:
5858
os-type: ubuntu
5959
build-type: asan
6060
compiler-family: clang
61-
c-compiler: clang-14
62-
cc-compiler: clang++-14
61+
c-compiler: clang-13
62+
cc-compiler: clang++-13
6363
debug: debug
6464
coverage: nocoverage
6565
# This test gives false positives on newer versions of clang
@@ -78,30 +78,30 @@ jobs:
7878
os-type: ubuntu
7979
build-type: lsan
8080
compiler-family: clang
81-
c-compiler: clang-14
82-
cc-compiler: clang++-14
81+
c-compiler: clang-13
82+
cc-compiler: clang++-13
8383
debug: debug
8484
coverage: nocoverage
8585
- test-group: extra
8686
os: ubuntu-latest
8787
os-type: ubuntu
8888
build-type: tsan
8989
compiler-family: clang
90-
c-compiler: clang-14
91-
cc-compiler: clang++-14
90+
c-compiler: clang-13
91+
cc-compiler: clang++-13
9292
debug: debug
9393
coverage: nocoverage
9494
- test-group: extra
9595
os: ubuntu-latest
9696
os-type: ubuntu
9797
build-type: ubsan
9898
compiler-family: clang
99-
c-compiler: clang-14
100-
cc-compiler: clang++-14
99+
c-compiler: clang-13
100+
cc-compiler: clang++-13
101101
debug: debug
102102
coverage: nocoverage
103103
- test-group: extra
104-
os: ubuntu-20.04
104+
os: ubuntu-22.04
105105
os-type: ubuntu
106106
build-type: none
107107
compiler-family: gcc
@@ -110,7 +110,7 @@ jobs:
110110
debug: nodebug
111111
coverage: nocoverage
112112
- test-group: extra
113-
os: ubuntu-20.04
113+
os: ubuntu-22.04
114114
os-type: ubuntu
115115
build-type: none
116116
compiler-family: gcc
@@ -137,7 +137,7 @@ jobs:
137137
debug: nodebug
138138
coverage: nocoverage
139139
- test-group: extra
140-
os: ubuntu-latest
140+
os: ubuntu-22.04
141141
os-type: ubuntu
142142
build-type: none
143143
compiler-family: clang
@@ -146,7 +146,7 @@ jobs:
146146
debug: nodebug
147147
coverage: nocoverage
148148
- test-group: extra
149-
os: ubuntu-20.04
149+
os: ubuntu-22.04
150150
os-type: ubuntu
151151
build-type: none
152152
compiler-family: clang
@@ -155,7 +155,7 @@ jobs:
155155
debug: nodebug
156156
coverage: nocoverage
157157
- test-group: extra
158-
os: ubuntu-20.04
158+
os: ubuntu-22.04
159159
os-type: ubuntu
160160
build-type: none
161161
compiler-family: clang
@@ -164,7 +164,7 @@ jobs:
164164
debug: nodebug
165165
coverage: nocoverage
166166
- test-group: extra
167-
os: ubuntu-20.04
167+
os: ubuntu-22.04
168168
os-type: ubuntu
169169
build-type: none
170170
compiler-family: clang
@@ -173,7 +173,7 @@ jobs:
173173
debug: nodebug
174174
coverage: nocoverage
175175
- test-group: extra
176-
os: ubuntu-20.04
176+
os: ubuntu-22.04
177177
os-type: ubuntu
178178
build-type: none
179179
compiler-family: clang
@@ -182,7 +182,7 @@ jobs:
182182
debug: nodebug
183183
coverage: nocoverage
184184
- test-group: extra
185-
os: ubuntu-20.04
185+
os: ubuntu-22.04
186186
os-type: ubuntu
187187
build-type: none
188188
compiler-family: clang
@@ -191,7 +191,7 @@ jobs:
191191
debug: nodebug
192192
coverage: nocoverage
193193
- test-group: extra
194-
os: ubuntu-20.04
194+
os: ubuntu-latest
195195
os-type: ubuntu
196196
build-type: none
197197
compiler-family: clang
@@ -204,8 +204,8 @@ jobs:
204204
os-type: ubuntu
205205
build-type: none
206206
compiler-family: clang
207-
c-compiler: clang-14
208-
cc-compiler: clang++-14
207+
c-compiler: clang-13
208+
cc-compiler: clang++-13
209209
debug: nodebug
210210
coverage: nocoverage
211211
- test-group: extra
@@ -218,7 +218,7 @@ jobs:
218218
debug: nodebug
219219
coverage: nocoverage
220220
- test-group: extra
221-
os: ubuntu-20.04
221+
os: ubuntu-22.04
222222
os-type: ubuntu
223223
build-type: iwyu
224224
compiler-family: clang
@@ -264,7 +264,7 @@ jobs:
264264
coverage: nocoverage
265265
steps:
266266
- name: Checkout repository
267-
uses: actions/checkout@v4
267+
uses: actions/checkout@v2
268268
with:
269269
# We must fetch at least the immediate parents so that if this is
270270
# a pull request then we can checkout the head.
@@ -294,7 +294,7 @@ jobs:
294294
if: ${{ matrix.compiler-family == 'gcc' && matrix.os-type == 'ubuntu' }}
295295

296296
- name: Install valgrind if needed
297-
run: sudo apt-get install valgrind
297+
run: sudo apt-get install valgrind valgrind-dbg
298298
if: ${{ matrix.build-type == 'valgrind' && matrix.os-type == 'ubuntu' }}
299299

300300
- name: Install cpplint if needed
@@ -341,7 +341,7 @@ jobs:
341341

342342
- name: CURL from cache (for testing)
343343
id: cache-CURL
344-
uses: actions/cache@v4
344+
uses: actions/cache@v2
345345
with:
346346
path: curl-7.75.0
347347
key: ${{ matrix.os }}-CURL-pre-built
@@ -386,7 +386,7 @@ jobs:
386386

387387
- name: Fetch libmicrohttpd from cache
388388
id: cache-libmicrohttpd
389-
uses: actions/cache@v4
389+
uses: actions/cache@v2
390390
with:
391391
path: libmicrohttpd-0.9.64
392392
key: ${{ matrix.os }}-${{ matrix.c-compiler }}-libmicrohttpd-pre-built

examples/allowing_disallowing_methods.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
USA
1919
*/
2020

21-
#include <memory>
22-
2321
#include <httpserver.hpp>
2422

2523
class hello_world_resource : public httpserver::http_resource {

examples/basic_authentication.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
USA
1919
*/
2020

21-
#include <memory>
22-
#include <string>
23-
2421
#include <httpserver.hpp>
2522

2623
class user_pass_resource : public httpserver::http_resource {

examples/custom_access_log.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
*/
2020

2121
#include <iostream>
22-
#include <memory>
23-
#include <string>
2422

2523
#include <httpserver.hpp>
2624

examples/custom_error.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
USA
1919
*/
2020

21-
#include <memory>
22-
2321
#include <httpserver.hpp>
2422

2523
std::shared_ptr<httpserver::http_response> not_found_custom(const httpserver::http_request&) {

examples/deferred_with_accumulator.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@
1818
USA
1919
*/
2020

21-
#include <algorithm>
2221
#include <atomic>
2322
#include <cstring>
24-
#include <memory>
25-
#include <string>
2623
// cpplint errors on chrono and thread because they are replaced (in Chromium) by other google libraries.
2724
// This is not an issue here.
2825
#include <chrono> // NOLINT [build/c++11]

examples/digest_authentication.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
USA
1919
*/
2020

21-
#include <memory>
22-
2321
#include <httpserver.hpp>
2422

2523
#define MY_OPAQUE "11733b200778ce33060f31c9af70a870ba96ddd4"

examples/file_upload.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
*/
2020

2121
#include <iostream>
22-
#include <memory>
23-
#include <string>
24-
2522
#include <httpserver.hpp>
2623

2724
class file_upload_resource : public httpserver::http_resource {

examples/handlers.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
USA
1919
*/
2020

21-
#include <memory>
22-
2321
#include <httpserver.hpp>
2422

2523
class hello_world_resource : public httpserver::http_resource {

0 commit comments

Comments
 (0)