diff --git a/.github/workflows/analyzers.yml b/.github/workflows/analyzers.yml index a9e400117..a57ad17e6 100644 --- a/.github/workflows/analyzers.yml +++ b/.github/workflows/analyzers.yml @@ -7,14 +7,14 @@ on: types: - completed + jobs: pvs: + if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' runs-on: ubuntu-latest timeout-minutes: 10 - if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' - steps: - uses: haya14busa/action-workflow_run-status@v1 @@ -40,13 +40,13 @@ jobs: - name: get conan uses: turtlebrowser/get-conan@main - - name: cache conan + - name: cache deps uses: actions/cache@v2 with: path: | ~/.conan2 /Users/runner/.conan2/ - key: ${{ runner.os }}-conan-2 + key: deps-ci-ubuntu-clang-Release - name: run conan run: | @@ -122,13 +122,13 @@ jobs: - name: get conan uses: turtlebrowser/get-conan@main - - name: cache conan + - name: cache deps uses: actions/cache@v2 with: path: | ~/.conan2 /Users/runner/.conan2/ - key: ${{ runner.os }}-conan-2 + key: deps-ci-ubuntu-clang-Release - name: run conan run: | @@ -172,7 +172,7 @@ jobs: - name: Run sonar-scanner on PullRequest - if: github.event.workflow_run.event != 'push' + if: github.event.workflow_run.event == 'pull_request' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/cache_deps.yml b/.github/workflows/cache_deps.yml new file mode 100644 index 000000000..a8d487788 --- /dev/null +++ b/.github/workflows/cache_deps.yml @@ -0,0 +1,69 @@ +name: Cache deps + +on: + push: + branches: + - v2 + pull_request: + branches: + - v2 + schedule: + - cron: '0 0 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + +jobs: + cache_deps: + strategy: + matrix: + config: [{name: ci-ubuntu-gcc, os: ubuntu-latest}, + {name: ci-ubuntu-clang, os: ubuntu-latest}, + {name: ci-windows, os: windows-latest}, + {name: ci-macos, os: macos-12}] + build_type: [{config: Release}, {config: Debug}] + + timeout-minutes: 120 + runs-on: ${{ matrix.config.os }} + name: Cache deps on ${{ matrix.config.name }} for ${{ matrix.build_type.config }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Work around https://github.com/actions/runner-images/issues/8659 + - name: "Remove GCC 13 from runner image (workaround)" + if: matrix.config.os == 'ubuntu-latest' + shell: bash + run: | + sudo apt-get purge -y g++-13 gcc-13 libstdc++-13-dev + sudo apt-get install -y --allow-downgrades libstdc++-12-dev libstdc++6=12.* libgcc-s1=12.* + + - name: Install Qt + uses: jurplel/install-qt-action@v3 + with: + cache: true + + - name: get conan + uses: turtlebrowser/get-conan@main + + - name: cache deps + uses: actions/cache@v2 + with: + path: | + ~/.conan2 + /Users/runner/.conan2/ + key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }} + + - name: conan detect profile + run: | + conan profile detect --force + + - name: Run CMake + uses: lukka/run-cmake@v10 + with: + configurePreset: ${{ matrix.config.name }}-tests + configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=${{ matrix.build_type.config }}']" diff --git a/.github/workflows/ci v2.yml b/.github/workflows/ci v2.yml index 26aaa1afc..ced4bd3dd 100644 --- a/.github/workflows/ci v2.yml +++ b/.github/workflows/ci v2.yml @@ -1,21 +1,19 @@ name: CI v2 on: - push: - branches: - - v2 - - pull_request: - branches: - - v2 + workflow_run: + workflows: ["Cache deps"] + types: + - completed concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true - jobs: sanitize: + if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' + strategy: matrix: sanitizer: ["tsan", "asan", "lsan", "ubsan"] @@ -25,7 +23,13 @@ jobs: timeout-minutes: 15 steps: + - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_branch }} - name: Install Qt uses: jurplel/install-qt-action@v3 @@ -35,13 +39,13 @@ jobs: - name: get conan uses: turtlebrowser/get-conan@main - - name: cache conan + - name: cache deps uses: actions/cache@v2 with: path: | ~/.conan2 /Users/runner/.conan2/ - key: ${{ runner.os }}-conan-2 + key: deps-ci-ubuntu-clang-Release - name: run conan run: | @@ -67,6 +71,7 @@ jobs: testPreset: ci-sanitize tests: + if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' strategy: matrix: config: [{name: ci-ubuntu-gcc, os: ubuntu-latest}, @@ -81,9 +86,13 @@ jobs: name: ${{ matrix.type }} ${{ matrix.config.name }} ${{ matrix.build_type.config }} steps: + - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v4 with: - fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_branch }} # Work around https://github.com/actions/runner-images/issues/8659 - name: "Remove GCC 13 from runner image (workaround)" @@ -115,13 +124,13 @@ jobs: - name: get conan uses: turtlebrowser/get-conan@main - - name: cache conan + - name: cache deps uses: actions/cache@v2 with: path: | ~/.conan2 /Users/runner/.conan2/ - key: ${{ runner.os }}-conan-2 + key: deps-${{ matrix.config.name }}-${{ matrix.build_type.config }} - name: run conan run: | @@ -145,11 +154,19 @@ jobs: path: ${{github.workspace}}/build/test_results/benchmarks_results.json docs: + if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' + name: Build Doxygen Docs runs-on: ubuntu-latest steps: + - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_branch }} - uses: actions/setup-python@v5 with: { python-version: "3.8" } @@ -167,42 +184,32 @@ jobs: - name: Deploy uses: peaceiris/actions-gh-pages@v4 - if: github.event_name == 'push' && github.repository_owner == 'victimsnino' + if: github.event.workflow_run.event == 'push' && github.repository_owner == 'victimsnino' with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./gen_docs destination_dir: v2/docs use_rpp_as_package: + if: github.repository_owner == 'victimsnino' && github.event.workflow_run.conclusion == 'success' timeout-minutes: 20 runs-on: ubuntu-latest name: Test RPP as package - ubuntu-latest steps: + - uses: haya14busa/action-workflow_run-status@v1 - uses: actions/checkout@v4 with: - fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + repository: ${{ github.event.workflow_run.head_repository.full_name }} + ref: ${{ github.event.workflow_run.head_branch }} - name: Install Qt uses: jurplel/install-qt-action@v3 with: cache: true - - name: get conan - uses: turtlebrowser/get-conan@main - - - name: cache conan - uses: actions/cache@v2 - with: - path: | - ~/.conan2 - /Users/runner/.conan2/ - key: ${{ runner.os }}-conan-2 - - - name: run conan - run: | - conan profile detect --force - - name: Install project and build env: CC: gcc-10 diff --git a/.github/workflows/comment_benchmarks_v2.yml b/.github/workflows/comment_benchmarks_v2.yml index 91474f530..be012bc4a 100644 --- a/.github/workflows/comment_benchmarks_v2.yml +++ b/.github/workflows/comment_benchmarks_v2.yml @@ -54,7 +54,7 @@ jobs: - name: Find Comment uses: peter-evans/find-comment@v3 id: fc - if: github.event.workflow_run.event != 'push' + if: github.event.workflow_run.event == 'pull_request' with: issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }} comment-author: 'github-actions[bot]' @@ -69,7 +69,7 @@ jobs: - name: Update comment uses: peter-evans/create-or-update-comment@v4 - if: github.event.workflow_run.event != 'push' + if: github.event.workflow_run.event == 'pull_request' with: comment-id: ${{ steps.fc.outputs.comment-id }} issue-number: ${{ steps.source-run-info.outputs.pullRequestNumber }}