feat: add c api #112
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: Linux | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build-test-docs: | |
strategy: | |
fail-fast: true | |
matrix: | |
config: | |
- preset: linux-x64 | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install System Packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential cmake ninja-build python3 python3-pip doxygen | |
sudo pip3 install gcovr | |
sudo pip3 install -r docs/requirements.txt | |
- name: Setup vcpkg | |
working-directory: /opt | |
run: | | |
rm -rf vcpkg | |
git clone --single-branch --filter=blob:none https://github.com/Microsoft/vcpkg.git | |
./vcpkg/bootstrap-vcpkg.sh | |
./vcpkg/vcpkg integrate install | |
./vcpkg/vcpkg --version | |
test -d vcpkg-binary-cache || mkdir vcpkg-binary-cache | |
- name: Cache Vcpkg Dependencies | |
uses: actions/cache@v3 | |
with: | |
key: ${{matrix.config.preset}}-${{hashFiles('vcpkg.json')}} | |
path: /opt/vcpkg-binary-cache | |
- name: Configure | |
env: | |
VCPKG_ROOT: /opt/vcpkg | |
VCPKG_DEFAULT_BINARY_CACHE: /opt/vcpkg-binary-cache | |
run: cmake -S . --preset ${{matrix.config.preset}} -DPARSI_ENABLE_COVERAGE=ON -DPARSI_DOCS=ON | |
- name: Build Debug | |
run: | | |
cmake --build --preset ${{matrix.config.preset}} --config Debug | |
- name: Build Release | |
run: | | |
cmake --build --preset ${{matrix.config.preset}} --config Release | |
- name: Test Release | |
run: | | |
ctest -C Release --preset linux-tests | |
- name: Generate Coverage | |
run: | | |
cmake --build --preset ${{matrix.config.preset}} --target coverage | |
- name: Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: build/${{matrix.config.preset}}/coverage/coverage.xml | |
fail_ci_if_error: true | |
functionalities: fix | |
- name: Build Docs | |
run: | | |
cmake --build --preset ${{matrix.config.preset}} --target docs | |
mv build/${{matrix.config.preset}}/docs/sphinx _site | |
- name: Upload Pages Artifacts | |
uses: actions/upload-pages-artifact@v2 | |
deploy-docs: | |
if: success() && github.ref == 'refs/heads/main' | |
needs: build-test-docs | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{steps.deployment.outputs.page_url}} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |