Skip to content

ci: github action

ci: github action #12

Workflow file for this run

name: test
on:
push:
branches:
- main
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
VCPKG_FEATURE_FLAGS: dependencygraph
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Init Submodule
run: git submodule update --init --recursive --depth 1
- name: Download h2spec
run: |
wget https://github.com/summerwind/h2spec/releases/download/v2.6.0/h2spec_linux_amd64.tar.gz
tar -xzf h2spec_linux_amd64.tar.gz
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: CMake config
run: >
cmake
-Bbuild
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: cmake --build build --target NewHttpImpl
- name: Run
run: |
nohup ./build/NewHttpImpl &
sleep 3
./h2spec -p 9956 -j test.xml
# pkill NewHttpImpl
- name: Upload
uses: actions/upload-artifact@v4.4.0
if: success() || failure()
with:
name: test.zip
path: test.xml
# - name: Test report
# uses: dorny/test-reporter@v1.9.1
# if: success() || failure()
# with:
# name: test
# path: test.xml
# reporter: jest-junit