From 94b9b7d19c8dafd655faeb6ab6160c78ef7d4db2 Mon Sep 17 00:00:00 2001 From: Patrick Stotko Date: Sun, 11 Feb 2024 14:26:45 +0100 Subject: [PATCH] CI: Simplify job structure --- .github/dependabot.yml | 11 ++ .github/workflows/coverage.yml | 42 ++++- .github/workflows/docs.yml | 92 +++++++++++ .github/workflows/documentation.yml | 52 ------- .github/workflows/{analysis.yml => lint.yml} | 60 +++++++- .github/workflows/style.yml | 41 ----- .github/workflows/tests.yml | 153 +++++++++++++++++++ .github/workflows/ubuntu.yml | 146 ------------------ .github/workflows/windows.yml | 114 -------------- README.md | 8 +- 10 files changed, 358 insertions(+), 361 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/docs.yml delete mode 100644 .github/workflows/documentation.yml rename .github/workflows/{analysis.yml => lint.yml} (54%) delete mode 100644 .github/workflows/style.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .github/workflows/ubuntu.yml delete mode 100644 .github/workflows/windows.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..6c4b36953 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 06e7da51e..87352b19d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,8 +8,13 @@ on: pull_request: types: [opened, reopened, synchronize] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - Coverage: + compute: + name: "Compute" runs-on: ubuntu-22.04 steps: @@ -45,6 +50,26 @@ jobs: run: | bash tools/dev/run_coverage.sh + - uses: actions/upload-artifact@v4 + with: + name: Coverage Report + path: build/stdgpu_coverage.info + + publish: + name: Upload coverage report to Codecov + runs-on: ubuntu-22.04 + + needs: + - compute + + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: Coverage Report + path: build/stdgpu_coverage.info + - name: Upload coverage report uses: codecov/codecov-action@v4 with: @@ -53,3 +78,18 @@ jobs: fail_ci_if_error: true verbose: true disable_search: true + + checkcoverage: + if: always() + + needs: + - compute + - publish + + name: "Check Coverage" + runs-on: ubuntu-22.04 + + steps: + - uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 000000000..364c44bd4 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,92 @@ +name: Docs OpenMP + +on: + push: + branches: + - master + + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - name: Install OpenMP + shell: bash + run: | + bash tools/ubuntu/install_openmp.sh + + - name: Install docs dependencies + shell: bash + run: | + bash tools/ubuntu/install_docs_dependencies.sh + + - name: Download dependencies + shell: bash + run: | + bash tools/dev/download_dependencies.sh + + - name: Configure project + shell: bash + run: | + bash tools/backend/configure_openmp_documentation.sh + + - name: Build documentation + shell: bash + run: | + bash tools/dev/build_documentation.sh + + - uses: actions/upload-artifact@v4 + with: + name: Docs HTML + path: build/docs/html + + publish: + name: Upload release to GitHub Pages + runs-on: ubuntu-22.04 + if: github.event_name != 'pull_request' + + needs: + - build + + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: Docs HTML + path: build/docs/html + + - uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: build/docs/html + clean: true + single-commit: true + + checkdocs: + if: always() + + needs: + - build + - publish + + name: "Check Docs" + runs-on: ubuntu-22.04 + + steps: + - uses: re-actors/alls-green@release/v1 + with: + allowed-skips: publish + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 9899121c2..000000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Documentation OpenMP - -on: - push: - branches: - - master - - pull_request: - types: [opened, reopened, synchronize] - -permissions: - contents: write - -jobs: - Doxygen: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - - name: Install OpenMP - shell: bash - run: | - bash tools/ubuntu/install_openmp.sh - - - name: Install docs dependencies - shell: bash - run: | - bash tools/ubuntu/install_docs_dependencies.sh - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp_documentation.sh - - - name: Build documentation - shell: bash - run: | - bash tools/dev/build_documentation.sh - - - name: Deploy documentation - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: build/docs/html - clean: true - single-commit: true - if: github.event_name != 'pull_request' diff --git a/.github/workflows/analysis.yml b/.github/workflows/lint.yml similarity index 54% rename from .github/workflows/analysis.yml rename to .github/workflows/lint.yml index 96d7f30f2..1abb91774 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: Analysis OpenMP +name: Lint OpenMP on: push: @@ -8,8 +8,45 @@ on: pull_request: types: [opened, reopened, synchronize] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - Clang-Tidy: + clangformat: + name: "Clang-Format" + runs-on: ubuntu-20.04 # Keep Ubuntu 20.04 until raising the requirements to clang-format > 10 + + steps: + - uses: actions/checkout@v4 + + - name: Install OpenMP + shell: bash + run: | + bash tools/ubuntu/install_openmp.sh + + - name: Install clang-format + shell: bash + run: | + bash tools/ubuntu/install_clang_format.sh + + - name: Download dependencies + shell: bash + run: | + bash tools/dev/download_dependencies.sh + + - name: Configure project + shell: bash + run: | + bash tools/backend/configure_openmp.sh + + - name: Check style + shell: bash + run: | + bash tools/dev/check_code_style.sh + + clangtidy: + name: "Clang-Tidy" runs-on: ubuntu-22.04 steps: @@ -40,7 +77,8 @@ jobs: run: | bash tools/build.sh Debug - Cppcheck: + cppcheck: + name: "Cppcheck" runs-on: ubuntu-22.04 steps: @@ -70,3 +108,19 @@ jobs: shell: bash run: | bash tools/build.sh Debug + + checklint: + if: always() + + needs: + - clangformat + - clangtidy + - cppcheck + + name: "Check Lint" + runs-on: ubuntu-22.04 + + steps: + - uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml deleted file mode 100644 index 3f0299db2..000000000 --- a/.github/workflows/style.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Code Style - -on: - push: - branches: - - master - - pull_request: - types: [opened, reopened, synchronize] - -jobs: - Clang-Format: - runs-on: ubuntu-20.04 # Keep Ubuntu 20.04 until raising the requirements to clang-format > 10 - - steps: - - uses: actions/checkout@v4 - - - name: Install OpenMP - shell: bash - run: | - bash tools/ubuntu/install_openmp.sh - - - name: Install clang-format - shell: bash - run: | - bash tools/ubuntu/install_clang_format.sh - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp.sh - - - name: Check style - shell: bash - run: | - bash tools/dev/check_code_style.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..3f29ca6cb --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,153 @@ +name: Tests OpenMP + +on: + push: + branches: + - master + + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ubuntu: + strategy: + matrix: + os: ['ubuntu-20.04', 'ubuntu-22.04'] + build_type: [Debug, Release] + shared_libs: [ON, OFF] + use_32bit_index: [ON, OFF] + cxx: [g++, clang++] + include: + - cxx: g++ + cc: gcc + - cxx: clang++ + cc: clang + + name: "${{ matrix.os }} / ${{ matrix.cxx }} / ${{ matrix.build_type }} / SHARED: ${{ matrix.shared_libs }} / 32-bit Index: ${{ matrix.use_32bit_index }}" + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install OpenMP + shell: bash + run: | + bash tools/ubuntu/install_openmp.sh + + - name: Download dependencies + shell: bash + run: | + bash tools/dev/download_dependencies.sh + + - name: Set C/C++ compiler + shell: bash + run: | + bash tools/ubuntu/set_cxx_compiler.sh ${{ matrix.cc }} ${{ matrix.cxx }} + + - name: Configure project + shell: bash + run: | + bash tools/backend/configure_openmp.sh ${{ matrix.build_type }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.use_32bit_index }} + + - name: Build project + shell: bash + run: | + bash tools/build.sh ${{ matrix.build_type }} + + - name: Run tests + shell: bash + run: | + bash tools/run_tests.sh ${{ matrix.build_type }} + + - name: Verify headers + shell: bash + run: | + bash tools/dev/verify_headers.sh + + - name: Install project + shell: bash + run: | + bash tools/install.sh ${{ matrix.build_type }} + + - name: Check linking to installed project + shell: bash + run: | + bash tools/backend/check_install_openmp.sh ${{ matrix.build_type }} + + - name: Uninstall project + shell: bash + run: | + bash tools/uninstall.sh ${{ matrix.build_type }} + + windows: + strategy: + matrix: + os: ['windows-2019', 'windows-2022'] + build_type: [Debug, Release] + shared_libs: [ON, OFF] + use_32bit_index: [ON, OFF] + + name: "${{ matrix.os }} / ${{ matrix.build_type }} / SHARED: ${{ matrix.shared_libs }} / 32-bit Index: ${{ matrix.use_32bit_index }}" + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Download dependencies + shell: bash + run: | + bash tools/dev/download_dependencies.sh + + - name: Configure project + shell: bash + run: | + bash tools/backend/configure_openmp.sh ${{ matrix.build_type }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.shared_libs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.use_32bit_index }} -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE + + - name: Build project + shell: bash + run: | + bash tools/build.sh ${{ matrix.build_type }} + + - name: Run tests + shell: bash + run: | + bash tools/run_tests.sh ${{ matrix.build_type }} + + - name: Verify headers + shell: bash + run: | + bash tools/dev/verify_headers.sh + + - name: Install project + shell: bash + run: | + bash tools/install.sh ${{ matrix.build_type }} + + - name: Check linking to installed project + shell: bash + run: | + bash tools/backend/check_install_openmp.sh ${{ matrix.build_type }} + + - name: Uninstall project + shell: bash + run: | + bash tools/uninstall.sh ${{ matrix.build_type }} + + checktests: + if: always() + + needs: + - ubuntu + - windows + + name: "Check Tests" + runs-on: ubuntu-22.04 + + steps: + - uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index eab00cbf8..000000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,146 +0,0 @@ -name: Ubuntu OpenMP - -on: - push: - branches: - - master - - pull_request: - types: [opened, reopened, synchronize] - -jobs: - Ubuntu-2004: - runs-on: ubuntu-20.04 - - strategy: - matrix: - CXX: [g++, clang++] - BuildType: [Debug, Release] - SharedLibs: [ON, OFF] - Use32BitIndex: [ON, OFF] - include: - - CXX: g++ - CC: gcc - - CXX: clang++ - CC: clang - - steps: - - uses: actions/checkout@v4 - - - name: Install OpenMP - shell: bash - run: | - bash tools/ubuntu/install_openmp.sh - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Set C/C++ compiler - shell: bash - run: | - bash tools/ubuntu/set_cxx_compiler.sh ${{ matrix.CC }} ${{ matrix.CXX }} - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp.sh ${{ matrix.BuildType }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.SharedLibs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.Use32BitIndex }} - - - name: Build project - shell: bash - run: | - bash tools/build.sh ${{ matrix.BuildType }} - - - name: Run tests - shell: bash - run: | - bash tools/run_tests.sh ${{ matrix.BuildType }} - - - name: Verify headers - shell: bash - run: | - bash tools/dev/verify_headers.sh - - - name: Install project - shell: bash - run: | - bash tools/install.sh ${{ matrix.BuildType }} - - - name: Check linking to installed project - shell: bash - run: | - bash tools/backend/check_install_openmp.sh ${{ matrix.BuildType }} - - - name: Uninstall project - shell: bash - run: | - bash tools/uninstall.sh ${{ matrix.BuildType }} - - Ubuntu-2204: - runs-on: ubuntu-22.04 - - strategy: - matrix: - CXX: [g++, clang++] - BuildType: [Debug, Release] - SharedLibs: [ON, OFF] - Use32BitIndex: [ON, OFF] - include: - - CXX: g++ - CC: gcc - - CXX: clang++ - CC: clang - - steps: - - uses: actions/checkout@v4 - - - name: Install OpenMP - shell: bash - run: | - bash tools/ubuntu/install_openmp.sh - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Set C/C++ compiler - shell: bash - run: | - bash tools/ubuntu/set_cxx_compiler.sh ${{ matrix.CC }} ${{ matrix.CXX }} - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp.sh ${{ matrix.BuildType }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.SharedLibs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.Use32BitIndex }} - - - name: Build project - shell: bash - run: | - bash tools/build.sh ${{ matrix.BuildType }} - - - name: Run tests - shell: bash - run: | - bash tools/run_tests.sh ${{ matrix.BuildType }} - - - name: Verify headers - shell: bash - run: | - bash tools/dev/verify_headers.sh - - - name: Install project - shell: bash - run: | - bash tools/install.sh ${{ matrix.BuildType }} - - - name: Check linking to installed project - shell: bash - run: | - bash tools/backend/check_install_openmp.sh ${{ matrix.BuildType }} - - - name: Uninstall project - shell: bash - run: | - bash tools/uninstall.sh ${{ matrix.BuildType }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 08e975e53..000000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,114 +0,0 @@ -name: Windows OpenMP - -on: - push: - branches: - - master - - pull_request: - types: [opened, reopened, synchronize] - -jobs: - Windows-2019: - runs-on: windows-2019 - - strategy: - matrix: - BuildType: [Debug, Release] - SharedLibs: [ON, OFF] - Use32BitIndex: [ON, OFF] - - steps: - - uses: actions/checkout@v4 - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp.sh ${{ matrix.BuildType }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.SharedLibs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.Use32BitIndex }} -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE - - - name: Build project - shell: bash - run: | - bash tools/build.sh ${{ matrix.BuildType }} - - - name: Run tests - shell: bash - run: | - bash tools/run_tests.sh ${{ matrix.BuildType }} - - - name: Verify headers - shell: bash - run: | - bash tools/dev/verify_headers.sh - - - name: Install project - shell: bash - run: | - bash tools/install.sh ${{ matrix.BuildType }} - - - name: Check linking to installed project - shell: bash - run: | - bash tools/backend/check_install_openmp.sh ${{ matrix.BuildType }} - - - name: Uninstall project - shell: bash - run: | - bash tools/uninstall.sh ${{ matrix.BuildType }} - - Windows-2022: - runs-on: windows-2022 - - strategy: - matrix: - BuildType: [Debug, Release] - SharedLibs: [ON, OFF] - Use32BitIndex: [ON, OFF] - - steps: - - uses: actions/checkout@v4 - - - name: Download dependencies - shell: bash - run: | - bash tools/dev/download_dependencies.sh - - - name: Configure project - shell: bash - run: | - bash tools/backend/configure_openmp.sh ${{ matrix.BuildType }} -DSTDGPU_BUILD_SHARED_LIBS=${{ matrix.SharedLibs }} -DSTDGPU_USE_32_BIT_INDEX=${{ matrix.Use32BitIndex }} -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE - - - name: Build project - shell: bash - run: | - bash tools/build.sh ${{ matrix.BuildType }} - - - name: Run tests - shell: bash - run: | - bash tools/run_tests.sh ${{ matrix.BuildType }} - - - name: Verify headers - shell: bash - run: | - bash tools/dev/verify_headers.sh - - - name: Install project - shell: bash - run: | - bash tools/install.sh ${{ matrix.BuildType }} - - - name: Check linking to installed project - shell: bash - run: | - bash tools/backend/check_install_openmp.sh ${{ matrix.BuildType }} - - - name: Uninstall project - shell: bash - run: | - bash tools/uninstall.sh ${{ matrix.BuildType }} diff --git a/README.md b/README.md index 14fd610d6..0f7e53af8 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@

- - + + - - + +