diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 91d3bd5..9f13bdc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,63 +2,100 @@ name: Build and Test on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] + release: + types: [published] jobs: Windows: runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - uses: microsoft/setup-msbuild@v2 - - name: Build - run: | - nuget restore vcproj\SimpleIni.sln - msbuild vcproj\SimpleIni.sln /p:Configuration=Release - - name: Run tests - run: | - cd tests - ..\vcproj\x64\Release\tests.exe + - name: Checkout code + uses: actions/checkout@v5 + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Build + run: | + nuget restore vcproj\SimpleIni.sln + msbuild vcproj\SimpleIni.sln /p:Configuration=Release + + - name: Run tests + run: | + cd tests + ..\vcproj\x64\Release\tests.exe Ubuntu: runs-on: ubuntu-latest steps: - - name: Install requirements - run: sudo apt install libgtest-dev cmake - - uses: actions/checkout@v3 - - run: make all && make test - - - name: test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=OFF) - run: | - cmake . -B build -DSIMPLEINI_USE_SYSTEM_GTEST=OFF - cmake --build build - ctest --verbose --test-dir build - - name: test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=ON) - run: | - cmake . -B build-system-gtest -DSIMPLEINI_USE_SYSTEM_GTEST=ON - cmake --build build-system-gtest - ctest --verbose --test-dir build-system-gtest + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install requirements + run: | + sudo apt install libgtest-dev cmake + + - name: Test with Makefile + run: | + make all && make test + + - name: Test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=OFF) + run: | + cmake . -B build -DSIMPLEINI_USE_SYSTEM_GTEST=OFF + cmake --build build + ctest --verbose --test-dir build + + - name: Test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=ON) + run: | + cmake . -B build-system-gtest -DSIMPLEINI_USE_SYSTEM_GTEST=ON + cmake --build build-system-gtest + ctest --verbose --test-dir build-system-gtest MacOS: runs-on: macos-latest steps: - - name: Install requirements - run: brew install googletest cmake - - uses: actions/checkout@v3 - - name: Run make tests - run: | - export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix googletest)/lib/pkgconfig:$PKG_CONFIG_PATH" - make all && make test - - - name: test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=OFF) - run: | - cmake . -B build -DSIMPLEINI_USE_SYSTEM_GTEST=OFF - cmake --build build - ctest --verbose --test-dir build - - name: test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=ON) - run: | - cmake . -B build-system-gtest -DSIMPLEINI_USE_SYSTEM_GTEST=ON - cmake --build build-system-gtest - ctest --verbose --test-dir build-system-gtest + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install requirements + run: brew install googletest cmake + + - name: Test with Makefile + run: | + export PKG_CONFIG_PATH="$(brew --prefix)/lib/pkgconfig:$(brew --prefix googletest)/lib/pkgconfig:$PKG_CONFIG_PATH" + make all && make test + + - name: Test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=OFF) + run: | + cmake . -B build -DSIMPLEINI_USE_SYSTEM_GTEST=OFF + cmake --build build + ctest --verbose --test-dir build + + - name: Test with CMake (-DSIMPLEINI_USE_SYSTEM_GTEST=ON) + run: | + cmake . -B build-system-gtest -DSIMPLEINI_USE_SYSTEM_GTEST=ON + cmake --build build-system-gtest + ctest --verbose --test-dir build-system-gtest + + Doxygen: + needs: [Ubuntu, Windows, MacOS] + if: ${{ always() && github.event_name != 'pull_request' }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Install Doxygen + run: sudo apt-get update && sudo apt-get install -y doxygen graphviz + + - name: Generate Documentation + run: doxygen Doxyfile + + - name: Deploy Documentation to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/html diff --git a/.github/workflows/build-doxygen.yml b/.github/workflows/build-doxygen.yml deleted file mode 100644 index ac87801..0000000 --- a/.github/workflows/build-doxygen.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Build Doxygen Docs - -on: - workflow_run: - workflows: ["Build and Test"] - types: - - completed - -jobs: - deploy: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Doxygen - run: sudo apt-get update && sudo apt-get install -y doxygen graphviz - - name: Generate Doxygen Documentation - run: doxygen Doxyfile - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/html diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index a96a71f..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: "CodeQL" - -on: workflow_dispatch -#on: -# push: -# branches: [ "master" ] -# pull_request: -# branches: [ "master" ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.gitignore b/.gitignore index 47ef8d9..a3bdea5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,11 @@ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore docs +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +dist/ +build/ # User-specific files