-
Notifications
You must be signed in to change notification settings - Fork 16
116 lines (98 loc) · 3.49 KB
/
Copy pathbuild.yml
File metadata and controls
116 lines (98 loc) · 3.49 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
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
name: Build
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
build-windows:
name: Windows x86
runs-on: windows-2022
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure
run: >
cmake -S . -B cmake-build-win32
-G "Visual Studio 17 2022"
-A Win32
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build cmake-build-win32 --target easy_http --config Release --parallel
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: easy_http-windows-win32
path: |
out/bin/Release/**
out/pdb/Release/**
if-no-files-found: error
retention-days: 14
build-linux:
name: Linux i386
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Restore dependencies (cache)
id: deps-cache
uses: actions/cache@v4
with:
path: .deps
key: deps-linux-i386-${{ hashFiles('.github/deps.lock') }}
- name: Fetch dependencies (cache miss)
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
set -euo pipefail
while IFS='=' read -r k v; do
case "$k" in DEPS_REPO|DEPS_TAG|DEPS_ASSET|DEPS_SHA256) declare "$k=$v" ;; esac
done < .github/deps.lock
mkdir -p .deps
curl -fSL -o bundle.tgz "https://github.com/$DEPS_REPO/releases/download/$DEPS_TAG/$DEPS_ASSET"
if [ -n "${DEPS_SHA256:-}" ]; then echo "$DEPS_SHA256 bundle.tgz" | sha256sum -c -; fi
tar -xzf bundle.tgz -C .deps
rm -f bundle.tgz
- name: Build in Ubuntu 14.04 container
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace ubuntu:14.04 bash -c '
set -e
# Add PPA for newer GCC
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
# Install build dependencies with multilib support
apt-get install -y \
gcc-9 g++-9 gcc-9-multilib g++-9-multilib \
make git wget \
libc6-dev libc6-dev-i386 \
lib32stdc++-9-dev
# Install CMake 3.10+
wget -q https://cmake.org/files/v3.16/cmake-3.16.9-Linux-x86_64.tar.gz
tar -xzf cmake-3.16.9-Linux-x86_64.tar.gz
export PATH=$(pwd)/cmake-3.16.9-Linux-x86_64/bin:$PATH
# Set GCC 9 as default
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 90
# Build
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DFETCHCONTENT_SOURCE_DIR_AMXXDEPS=/workspace/.deps
cmake --build . --target easy_http -j$(nproc)
'
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: easy_http-linux-i386
path: out/bin/Release/easy_http_amxx_i386.so
if-no-files-found: error
retention-days: 14