forked from lwthiker/curl-impersonate
-
-
Notifications
You must be signed in to change notification settings - Fork 129
83 lines (71 loc) · 2.31 KB
/
test.yml
File metadata and controls
83 lines (71 loc) · 2.31 KB
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
name: Test
on:
push:
branches:
- main
- feature/*
- bugfix/*
- chore/*
- security/*
pull_request:
branches:
- main
permissions:
contents: read
env:
BORING_SSL_COMMIT: 673e61fc215b178a90c0e67858bbf162c8158993
jobs:
test-linux:
name: (x86_64-linux-gnu) Build and run tests
runs-on: ubuntu-latest
env:
CC: ${{ github.workspace }}/zigshim/cc
CXX: ${{ github.workspace }}/zigshim/cxx
AR: ${{ github.workspace }}/zigshim/ar
ZIG_FLAGS: -target x86_64-linux-gnu.2.17
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.14.0
- name: Install Ubuntu dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential pkg-config cmake ninja-build curl autoconf automake libtool
sudo apt-get install golang-go
# Needed to compile 'minicurl'
sudo apt-get install libcurl4-openssl-dev
# More dependencies for the tests
sudo apt-get install tcpdump nghttp2-server
- name: Run configure script
run: |
mkdir ${{ runner.temp }}/install
./configure --prefix=${{ runner.temp }}/install \
--host=x86_64-linux-gnu \
--with-ca-path=/etc/ssl/certs \
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
- name: Build curl-impersonate
run: |
make build
make checkbuild
make install
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies for the tests script
run: |
pip3 install -r tests/requirements.txt
- name: Prepare the tests
run: |
# Compile 'minicurl' which is used by the tests
gcc -Wall -Werror -o ${{ runner.temp }}/install/bin/minicurl tests/minicurl.c `curl-config --libs`
- name: Run the tests
run: |
cd tests
# sudo is needed for capturing packets
python_bin=$(which python3)
sudo $python_bin -m pytest . --log-cli-level DEBUG --install-dir ${{ runner.temp }}/install --capture-interface eth0