3proxy/.github/workflows/c-cpp.yml
Vladimir Dubrovin 449f7bfab8 Update c-cpp.yml
2026-03-27 20:15:32 +03:00

57 lines
2.2 KiB
YAML

name: C/C++ CI
on:
push:
branches: [ "master" ]
paths: [ '**.c', '**.h', 'Makefile.**', '.github/configs', '.github/workflows/c-cpp.yml' ]
pull_request:
branches: [ "master" ]
paths: [ '**.c', '**.h', 'Makefile.**', '.github/configs', '.github/workflows/c-cpp.yml' ]
jobs:
ci:
name: "${{ matrix.target }}"
strategy:
matrix:
target:
- ubuntu-latest
- ubuntu-24.04-arm
- macos-15
- windows-2022
runs-on: ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
# - name: configure
# run: ./configure
- name: ln Linux
if: ${{ startsWith(matrix.target, 'ubuntu') }}
run: ln -s Makefile.Linux Makefile
- name: Linux libraries
if: ${{ startsWith(matrix.target, 'ubuntu') }}
run: sudo apt install libssl-dev libpam-dev libpcre3 libpcre3-dev
- name: Mac libraries
if: ${{ startsWith(matrix.target, 'macos') }}
run: brew install pcre
- name: ln Mac
if: ${{ startsWith(matrix.target, 'macos') }}
run: ln -s Makefile.FreeBSD Makefile
- name: Mac variables
if: ${{ startsWith(matrix.target, 'macos') }}
run: echo "LDFLAGS=-L/usr/local/lib -L/opt/homebrew/lib -L/usr/local/opt/openssl/lib -L/opt/homebrew/opt/openssl/lib" >> $GITHUB_ENV && echo "CFLAGS=-I/usr/local/include -I/opt/homebrew/include -I/usr/local/opt/openssl/include -I/opt/homebrew/opt/openssl/include" >> $GITHUB_ENV
- name: ln Windows
if: ${{ startsWith(matrix.target, 'windows') }}
run: copy Makefile.win Makefile
- name: dirs Windows
if: ${{ startsWith(matrix.target, 'windows') }}
run: cmd /C 'echo LIBS := -L "c:/program files/openssl/lib/VC/x64/MT" $(LIBS) >>Makefile.win && echo CFLAGS := -I "c:/program files/openssl/include" $(CFLAGS) >>Makefile.win && type Makefile.win && dir "c:/program files/openssl/lib" && set && dir "C:/mingw64/bin" '
- name: make
run: make
- name: mkdir
if: ${{ startsWith(matrix.target, 'ubuntu') }}
run: mkdir ~/3proxy
- name: make install
if: ${{ startsWith(matrix.target, 'ubuntu') }}
run: make DESTDIR=~/3proxy install
- name: make clean
run: make clean