Add write permissions to GitHub Actions workflow #2
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: C++ CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake g++ libgtest-dev doxygen graphviz | |
cd /usr/src/gtest | |
sudo cmake CMakeLists.txt | |
sudo make | |
sudo cp lib/*.a /usr/lib | |
- name: Configure CMake | |
run: cmake -B build -DBUILD_TESTING=ON | |
- name: Build | |
run: cmake --build build | |
- name: Run tests | |
run: | | |
cd build | |
ctest --output-on-failure | |
- name: Generate documentation | |
run: doxygen Doxyfile | |
- name: Deploy documentation | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs/html |