Enable CI on every commit

This commit is contained in:
bugdea1er 2024-05-01 19:49:01 +03:00
parent 4fbd9b471f
commit c2b9dc825b
3 changed files with 3 additions and 126 deletions

View File

@ -1,17 +1,11 @@
name: Build and test
#on: push
name: Tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
- push
- pull_request
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
COVERALLS_PULL_REQUEST: ${{ github.event.number }}
#COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
jobs:
build:
@ -86,33 +80,3 @@ jobs:
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest --output-on-failure -C ${{env.BUILD_TYPE}}
- name: Generate coverage report
if: matrix.os == 'ubuntu-latest'
run: |
export CI_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
echo "CI_BRANCH=$CI_BRANCH" >> $GITHUB_ENV && \
export TRAVIS_JOB_ID=$GITHUB_RUN_NUMBER && \
git clone https://github.com/CrowCpp/cpp-coveralls.git && \
cd cpp-coveralls && \
pip3 install . --no-input && \
cd .. && \
coveralls --verbose --exclude-pattern .*/http_parser_merged.h --exclude-pattern .*/TinySHA1.hpp --dump coveralls.json
shell: bash
- name: Save report
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: coveralls.json
path: coveralls.json
#- name: Package
# working-directory: ${{github.workspace}}/build
# run: |
# cmake --build . --target ALL_BUILD && \
# cmake --build . --target doc && \
# cmake --build . --target package && \
# cpack --config CPackSourceConfig.cmake

View File

@ -1,42 +0,0 @@
name: Deploy Doxygen results to Github Pages
#on: push
on:
push:
branches:
- master
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }} # Recommended if you intend to make multiple deployments in quick succession.
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Prepare dependencies
run: sudo apt-get update && sudo apt-get -yq install libasio-dev doxygen mkdocs graphviz zlib1g-dev gcc clang make cmake python3 python3-pip git openssl libssl-dev
- name: prepate pip dependencies
run: pip3 install mkdocs-material mkdocs-redirects pyyaml mkdocs-meta-descriptions-plugin mike --no-input
- name: configure
run: cmake -B build -DCROW_AMALGAMATE=ON
- name: clean generated docs dir
run: rm -rf site docs/reference
- name: clone doxygen theme
run: git clone https://github.com/CrowCpp/darxygen.git
- name: run doxygen
run: doxygen
- name: run mkdocs
run: mkdocs build
- name: Setup doc deploy
run: |
git config --global user.name Docs deploy
git config --global user.email docs@dummy.bot.com
- name: run mike
run: mike deploy master
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: site # The folder the action should deploy.
target-folder: master # deploy to versioned directory

View File

@ -1,45 +0,0 @@
name: Submit coverage
# read-write repo token
# access to secrets
on:
workflow_run:
workflows: [Build and test]
types: [completed]
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
jobs:
upload:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifact
uses: dawidd6/action-download-artifact@v3
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
name: coveralls.json
- name: 'Prepare dependencies'
run: |
sudo apt-get update && \
sudo apt-get install -yq \
jq \
curl
shell: bash
- name: 'Generate full report'
run: |
cat coveralls.json | jq --arg repo_token $COVERALLS_REPO_TOKEN '. += {repo_token: $repo_token}' > coveralls_full.json
shell: bash
- name: 'Upload final report'
run: |
curl --request POST \
--url https://coveralls.io/api/v1/jobs \
--header 'Content-Type: multipart/form-data' \
--form json_file=@./coveralls_full.json
shell: bash