Assign a higher precedence to the manually set Content-Type #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New Commit | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Build | |
run: | | |
export CHTTP_VERSION=$(git describe --tags | sed 's/^v//') | |
echo "CHTTP_VERSION=${CHTTP_VERSION}" >> $GITHUB_ENV | |
./dist.sh | |
- name: Upload binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gmod-chttp-${{ env.CHTTP_VERSION }}-binaries | |
path: dist/* | |
format: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install clang-format | |
run: | | |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main' | |
sudo apt-get update | |
sudo apt-get install -y clang-format-18 | |
- name: Run clang-format | |
run: clang-format-18 -style=file -i src/*.cpp src/*.h | |
- name: Check for changes | |
run: git diff --exit-code | |
test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
export DEBIAN_FRONTEND=noninteractive | |
sudo apt-get update | |
sudo apt-get install -y python3-flask | |
- name: Checkout gmod-chttp | |
uses: actions/checkout@v3 | |
with: | |
path: 'gmod-chttp' | |
fetch-depth: 0 | |
submodules: true | |
- name: Build gmod-chttp | |
working-directory: 'gmod-chttp' | |
run: | | |
export CHTTP_VERSION=$(git describe --tags | sed 's/^v//') | |
echo "CHTTP_VERSION=${CHTTP_VERSION}" >> $GITHUB_ENV | |
./dist.sh | |
- name: Checkout gmod-lua-runner | |
uses: actions/checkout@v3 | |
with: | |
repository: 'timschumi/gmod-lua-runner' | |
path: 'gmod-lua-runner' | |
submodules: true | |
- name: Build gmod-lua-runner | |
run: | | |
cmake -B gmod-lua-runner-build -DCMAKE_TOOLCHAIN_FILE=toolchain-linux64.cmake gmod-lua-runner | |
cmake --build gmod-lua-runner-build --target package | |
- name: Checkout GLuaTest | |
uses: actions/checkout@v3 | |
with: | |
repository: 'CFC-Servers/GLuaTest' | |
path: 'GLuaTest' | |
- name: Create folder structure | |
run: | | |
tar -xf gmod-lua-runner-build/gmod-lua-runner-*-linux64.tar.gz | |
mv gmod-lua-runner-*-linux64 gmod-lua-runner-install | |
mkdir -p "gmod-lua-runner-install/garrysmod/lua/autorun" | |
mkdir -p "gmod-lua-runner-install/garrysmod/lua/bin" | |
mkdir -p "gmod-lua-runner-install/garrysmod/lua/tests" | |
ln -Tsv "${GITHUB_WORKSPACE}/GLuaTest/lua/autorun/gluatest.lua" "gmod-lua-runner-install/garrysmod/lua/autorun/gluatest.lua" | |
ln -Tsv "${GITHUB_WORKSPACE}/GLuaTest/lua/gluatest" "gmod-lua-runner-install/garrysmod/lua/gluatest" | |
ln -Tsv "${GITHUB_WORKSPACE}/gmod-chttp/tests" "gmod-lua-runner-install/garrysmod/lua/tests/gmod-chttp" | |
ln -sv "${GITHUB_WORKSPACE}/gmod-chttp/dist/"* "gmod-lua-runner-install/garrysmod/lua/bin/" | |
ln -Tsv "${GITHUB_WORKSPACE}/gmod-lua-runner/test.lua" "gmod-lua-runner-install/test.lua" | |
- name: Run tests | |
working-directory: 'gmod-lua-runner-install' | |
run: | | |
"${GITHUB_WORKSPACE}/gmod-chttp/tests/server.py" 1>/dev/null 2>&1 & | |
until curl --silent "http://127.0.0.1:5000" 1>/dev/null 2>&1; do sleep 1; done | |
export CHTTP_DISABLE_UPDATE_NOTIFICATION=1 | |
export CHTTP_DISABLE_TELEMETRY=1 | |
./runner test.lua | |
kill $! |