chore(deps): update actions/checkout action to v7.0.1 (#37) #86
This file contains hidden or 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: CI | |
| permissions: {} | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| env: | |
| OPENCPPCOVERAGE_VERSION: '0.9.9.0' | |
| PYTHON_VERSION: '3.14' | |
| jobs: | |
| release-setup: | |
| name: Release Setup | |
| outputs: | |
| publish_release: ${{ steps.release-setup.outputs.publish_release }} | |
| release_body: ${{ steps.release-setup.outputs.release_body }} | |
| release_commit: ${{ steps.release-setup.outputs.release_commit }} | |
| release_generate_release_notes: ${{ steps.release-setup.outputs.release_generate_release_notes }} | |
| release_tag: ${{ steps.release-setup.outputs.release_tag }} | |
| release_version: ${{ steps.release-setup.outputs.release_version }} | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Release Setup | |
| id: release-setup | |
| uses: LizardByte/actions/actions/release_setup@a46850981292c4bbc0c41715f286ad95adaaaf4a # v2026.625.20301 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| pytest: | |
| name: Pytest (${{ matrix.os }}) | |
| needs: | |
| - release-setup | |
| permissions: | |
| contents: read | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - macos-latest | |
| - ubuntu-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up Python | |
| id: setup-python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Sync Python tools | |
| env: | |
| UV_PYTHON: ${{ steps.setup-python.outputs.python-path }} | |
| run: uv sync --locked --only-group test-python | |
| - name: Test with pytest | |
| id: test | |
| run: uv run --locked --only-group test-python pytest | |
| - name: Upload test coverage | |
| # any except canceled or skipped | |
| if: >- | |
| always() && | |
| (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | |
| startsWith(github.repository, 'LizardByte/') | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| disable_search: true | |
| fail_ci_if_error: true | |
| files: ./coverage/python-coverage.xml | |
| flags: ${{ runner.os }}-python | |
| report_type: coverage | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| - name: Upload test results | |
| # any except canceled or skipped | |
| if: >- | |
| always() && | |
| (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && | |
| startsWith(github.repository, 'LizardByte/') | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| disable_search: true | |
| fail_ci_if_error: true | |
| files: ./junit-python.xml | |
| flags: ${{ runner.os }}-python | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| build: | |
| name: Build (${{ matrix.name }}) | |
| needs: | |
| - release-setup | |
| permissions: | |
| contents: read | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux-GCC | |
| os: ubuntu-latest | |
| shell: bash | |
| kind: unix | |
| cc: gcc | |
| cxx: g++ | |
| gcov_executable: gcov | |
| - name: Linux-Clang | |
| os: ubuntu-latest | |
| shell: bash | |
| kind: unix | |
| cc: clang | |
| cxx: clang++ | |
| # Clang writes LLVM coverage notes, so gcovr needs llvm-cov's gcov compatibility mode. | |
| gcov_executable: llvm-cov gcov | |
| - name: macOS | |
| os: macos-latest | |
| shell: bash | |
| kind: unix | |
| cc: clang | |
| cxx: clang++ | |
| gcov_executable: gcov | |
| - name: Windows-MinGW-UCRT64 | |
| os: windows-latest | |
| shell: msys2 {0} | |
| kind: msys2 | |
| cc: gcc | |
| cxx: g++ | |
| msystem: ucrt64 | |
| toolchain: ucrt-x86_64 | |
| gcov_executable: gcov | |
| - name: Windows-MSVC | |
| os: windows-2022 | |
| shell: pwsh | |
| kind: msvc | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Setup Dependencies Linux | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| clang \ | |
| cmake \ | |
| llvm \ | |
| ninja-build | |
| - name: Setup Dependencies macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| brew install \ | |
| cmake \ | |
| ninja | |
| - name: Setup Dependencies Windows MinGW | |
| if: matrix.kind == 'msys2' | |
| uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0 | |
| with: | |
| msystem: ${{ matrix.msystem }} | |
| update: true | |
| install: >- | |
| mingw-w64-${{ matrix.toolchain }}-cmake | |
| mingw-w64-${{ matrix.toolchain }}-ninja | |
| mingw-w64-${{ matrix.toolchain }}-toolchain | |
| - name: Setup Dependencies Windows MSVC | |
| if: matrix.kind == 'msvc' | |
| run: | | |
| choco install opencppcoverage --version=${{ env.OPENCPPCOVERAGE_VERSION }} --yes --no-progress | |
| $openCppCoverageDir = "${env:ProgramFiles}\OpenCppCoverage" | |
| if (!(Test-Path (Join-Path $openCppCoverageDir "OpenCppCoverage.exe"))) { | |
| $openCppCoverageDir = "${env:ProgramFiles(x86)}\OpenCppCoverage" | |
| } | |
| if (!(Test-Path (Join-Path $openCppCoverageDir "OpenCppCoverage.exe"))) { | |
| throw "OpenCppCoverage.exe was not found after Chocolatey install." | |
| } | |
| $openCppCoverageDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Set up Python | |
| id: setup-python | |
| if: matrix.kind != 'msvc' | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Set up uv | |
| if: matrix.kind != 'msvc' | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| with: | |
| enable-cache: true | |
| - name: Sync Python tools | |
| if: matrix.kind != 'msvc' | |
| env: | |
| MSYS2_PATH_TYPE: inherit | |
| UV_PYTHON: ${{ steps.setup-python.outputs.python-path }} | |
| run: | | |
| uv sync --locked --only-group test-c \ | |
| --no-python-downloads \ | |
| --no-install-project | |
| - name: Configure | |
| if: matrix.kind != 'msvc' | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| run: | | |
| cmake \ | |
| -DBUILD_DOCS=OFF \ | |
| -DBUILD_TESTS=ON \ | |
| -DCMAKE_BUILD_TYPE:STRING=Debug \ | |
| -B cmake-build-ci \ | |
| -G Ninja \ | |
| -S . | |
| - name: Configure MSVC | |
| if: matrix.kind == 'msvc' | |
| run: | | |
| cmake ` | |
| -DBUILD_DOCS=OFF ` | |
| -DBUILD_TESTS=ON ` | |
| -A x64 ` | |
| -B cmake-build-ci ` | |
| -G "Visual Studio 17 2022" ` | |
| -S . | |
| - name: Build | |
| if: matrix.kind != 'msvc' | |
| run: cmake --build cmake-build-ci -- -j2 | |
| - name: Build MSVC | |
| if: matrix.kind == 'msvc' | |
| run: cmake --build cmake-build-ci --config Debug --parallel 2 | |
| - name: Prepare report directory | |
| run: cmake -E make_directory cmake-build-ci/reports | |
| - name: Run tests | |
| id: test | |
| if: matrix.kind != 'msvc' | |
| working-directory: cmake-build-ci/tests | |
| run: ./test_lizardbyte_common --gtest_color=yes --gtest_output=xml:../reports/junit.xml | |
| - name: Run tests MSVC | |
| id: test_msvc | |
| if: matrix.kind == 'msvc' | |
| run: | | |
| $openCppCoverage = (Get-Command OpenCppCoverage.exe -ErrorAction SilentlyContinue).Source | |
| if (!$openCppCoverage) { | |
| $candidates = @( | |
| "${env:ProgramFiles}\OpenCppCoverage\OpenCppCoverage.exe", | |
| "${env:ProgramFiles(x86)}\OpenCppCoverage\OpenCppCoverage.exe" | |
| ) | |
| $openCppCoverage = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1 | |
| } | |
| if (!$openCppCoverage) { | |
| throw "OpenCppCoverage.exe was not found." | |
| } | |
| & $openCppCoverage ` | |
| --sources "$env:GITHUB_WORKSPACE\src" ` | |
| --sources "$env:GITHUB_WORKSPACE\tests\support" ` | |
| "--export_type=cobertura:$env:GITHUB_WORKSPACE\cmake-build-ci\reports\coverage.xml" ` | |
| --working_dir "$env:GITHUB_WORKSPACE\cmake-build-ci\tests" ` | |
| -- ` | |
| "$env:GITHUB_WORKSPACE\cmake-build-ci\tests\Debug\test_lizardbyte_common.exe" ` | |
| --gtest_color=yes ` | |
| "--gtest_output=xml:$env:GITHUB_WORKSPACE\cmake-build-ci\reports\junit.xml" | |
| - name: Normalize MSVC coverage paths | |
| if: >- | |
| always() && | |
| matrix.kind == 'msvc' && | |
| (steps.test_msvc.outcome == 'success' || steps.test_msvc.outcome == 'failure') | |
| run: | | |
| $coveragePath = Join-Path $env:GITHUB_WORKSPACE "cmake-build-ci\reports\coverage.xml" | |
| if (!(Test-Path $coveragePath)) { | |
| return | |
| } | |
| [xml] $coverage = Get-Content $coveragePath | |
| $workspace = $env:GITHUB_WORKSPACE.Replace('\', '/') | |
| foreach ($node in $coverage.SelectNodes('//*[@filename]')) { | |
| $filename = $node.GetAttribute('filename').Replace('\', '/') | |
| if ($filename.StartsWith("${workspace}/")) { | |
| $filename = $filename.Substring($workspace.Length + 1) | |
| } | |
| $node.SetAttribute('filename', $filename) | |
| } | |
| foreach ($source in $coverage.SelectNodes('//source')) { | |
| $source.InnerText = '.' | |
| } | |
| $coverage.Save($coveragePath) | |
| - name: Generate gcov report | |
| id: test_report | |
| if: >- | |
| always() && | |
| matrix.kind != 'msvc' && | |
| (steps.test.outcome == 'success' || steps.test.outcome == 'failure') | |
| working-directory: cmake-build-ci | |
| env: | |
| GCOV_EXECUTABLE: ${{ matrix.gcov_executable }} | |
| MSYS2_PATH_TYPE: inherit | |
| run: | | |
| uv run --project .. --locked --no-sync gcovr . -r .. \ | |
| --filter ../src \ | |
| --filter ../tests/support \ | |
| --gcov-executable "${GCOV_EXECUTABLE}" \ | |
| --exclude-noncode-lines \ | |
| --exclude-throw-branches \ | |
| --exclude-unreachable-branches \ | |
| --verbose \ | |
| --xml-pretty \ | |
| -o reports/coverage.xml | |
| - name: Install | |
| if: matrix.kind != 'msvc' | |
| run: cmake --install cmake-build-ci --prefix cmake-build-ci/install | |
| - name: Install MSVC | |
| if: matrix.kind == 'msvc' | |
| run: cmake --install cmake-build-ci --config Debug --prefix cmake-build-ci/install | |
| - name: Upload report artifact | |
| if: >- | |
| always() && | |
| ( | |
| steps.test_report.outcome == 'success' || | |
| steps.test_msvc.outcome == 'success' || | |
| steps.test_msvc.outcome == 'failure' | |
| ) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: reports-${{ matrix.name }} | |
| path: cmake-build-ci/reports | |
| if-no-files-found: error | |
| codecov: | |
| name: Codecov (${{ matrix.flag }}) | |
| if: >- | |
| always() && | |
| (needs.build.result == 'success' || needs.build.result == 'failure') && | |
| startsWith(github.repository, 'LizardByte/') | |
| needs: | |
| - build | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - build_name: Linux-GCC | |
| flag: Linux-GCC | |
| - build_name: Linux-Clang | |
| flag: Linux-Clang | |
| - build_name: macOS | |
| flag: macOS | |
| - build_name: Windows-MinGW-UCRT64 | |
| flag: Windows-MinGW-UCRT64 | |
| - build_name: Windows-MSVC | |
| flag: Windows-MSVC | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Download report artifact | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: reports-${{ matrix.build_name }} | |
| path: _reports | |
| - name: Debug coverage file | |
| run: cat _reports/coverage.xml | |
| - name: Upload test coverage | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| disable_search: true | |
| fail_ci_if_error: true | |
| files: ./_reports/coverage.xml | |
| flags: ${{ matrix.flag }} | |
| report_type: coverage | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| - name: Upload test results | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| disable_search: true | |
| fail_ci_if_error: true | |
| files: ./_reports/junit.xml | |
| flags: ${{ matrix.flag }} | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| create-release: | |
| name: Create Release | |
| if: >- | |
| (github.event_name == 'push' && github.ref == 'refs/heads/master') && | |
| needs.release-setup.outputs.publish_release == 'true' | |
| needs: | |
| - build | |
| - release-setup | |
| - pytest | |
| permissions: {} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create/Update GitHub Release | |
| uses: LizardByte/actions/actions/release_create@a46850981292c4bbc0c41715f286ad95adaaaf4a # v2026.625.20301 | |
| with: | |
| allowUpdates: true | |
| artifacts: '' | |
| body: ${{ needs.release-setup.outputs.release_body }} | |
| draft: true | |
| generateReleaseNotes: ${{ needs.release-setup.outputs.release_generate_release_notes }} | |
| name: ${{ needs.release-setup.outputs.release_tag }} | |
| prerelease: true | |
| tag: ${{ needs.release-setup.outputs.release_tag }} | |
| token: ${{ secrets.GH_BOT_TOKEN }} |