From e88ad8999477d6be62c3b30c27d4e0b1f22cfe69 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Tue, 27 Aug 2024 13:33:53 -0400 Subject: [PATCH] build: remove builds via github actions (#238) * build: update github action permissions * Remove building presubmits via github actions * Update update sync-repo-settings to reflect change --- .github/sync-repo-settings.yaml | 7 +- .github/workflows/presubmit.yml | 180 +------------------------------- 2 files changed, 7 insertions(+), 180 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 6fb098b0..b8e8a906 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -28,9 +28,10 @@ branchProtectionRules: requiresStrictStatusChecks: true # List of required status check contexts that must pass for commits to be accepted to matching branches. requiredStatusCheckContexts: - - 'ubuntu-20.04' - - 'macos-13' - - 'windows-2022 ( x64 )' + - 'Kokoro - Linux' + - 'Kokoro - OS X' + - 'Kokoro - OS X Apple Silicon' + - 'Kokoro - Windows' - 'cla/google' # List of explicit permissions to add (additive only) permissionRules: diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 71ff73bb..66626f0d 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -5,8 +5,10 @@ on: branches: - main -jobs: +permissions: + contents: read +jobs: mypy: runs-on: ubuntu-22.04 steps: @@ -25,179 +27,3 @@ jobs: SETUPTOOLS_ENABLE_FEATURES: legacy-editable run: | nox -s mypy - - build-wheels-linux: - name: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-20.04 - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Build Wheels - uses: pypa/cibuildwheel@v2.20.0 - env: - # For presubmit, just build / test the most common arch - CIBW_ARCHS: native - # For presubmit, skip build / test for pypy - CIBW_SKIP: pp37* - CIBW_ENVIRONMENT: > - CRC32C_PURE_PYTHON="0" - CRC32C_INSTALL_PREFIX="$(pwd)/usr" - CIBW_BUILD_VERBOSITY: 1 - # Build the C library inside CIBW so that the manylinux image is - # used to link the share library; otherwise, our extension wouldn't - # be able to link with it. - CIBW_BEFORE_BUILD: > - python -m pip install --upgrade setuptools pip wheel && - python -m pip install cmake && - cmake -S google_crc32c -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DCRC32C_BUILD_TESTS=no \ - -DCRC32C_BUILD_BENCHMARKS=no \ - -DBUILD_SHARED_LIBS=yes \ - -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/usr && - make -C build all install - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: py.test -v {project}/tests/ - - build-wheels-macos: - name: ${{ matrix.os }} - strategy: - matrix: - os: - - macos-13 - # Wheels port forward - #- macos-11 - runs-on: ${{ matrix.os }} - steps: - - - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Get C library hash - id: get-c-lib-hash - run: - echo "::set-output name=hash::$(git -C google_crc32c log -n 1 --pretty=%H)" - - - id: load-cache - name: Load cached C library - uses: actions/cache@v3 - with: - path: ${{ github.workspace }}/usr - key: - libcrc32c-${{ matrix.os }}-${{ steps.get-c-lib-hash.outputs.hash }} - - - name: Build C Library - if: steps.load-cache.outputs.cache-hit != 'true' - run: > - python -m pip install --upgrade setuptools pip wheel && - python -m pip install cmake && - cmake -S google_crc32c -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ - -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ - -DCRC32C_BUILD_TESTS=no \ - -DCRC32C_BUILD_BENCHMARKS=no \ - -DBUILD_SHARED_LIBS=yes \ - -DCMAKE_INSTALL_PREFIX:PATH=${{ github.workspace }}/usr \ - -DCMAKE_INSTALL_NAME_DIR:PATH=${{ github.workspace }}/usr/lib && - make -C build all install - - - name: Build Wheels - uses: pypa/cibuildwheel@v2.20.0 - env: - # For presubmit, just build / test the most common arch - CIBW_ARCHS: native - # For presubmit, skip build / test for pypy - CIBW_SKIP: pp37* - CIBW_ENVIRONMENT: > - CRC32C_PURE_PYTHON="0" - CRC32C_INSTALL_PREFIX="$(pwd)/usr" - CIBW_BUILD_VERBOSITY: 1 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: py.test -v {project}/tests/ - - build-wheels-windows: - name: ${{ matrix.os }} ( ${{ matrix.platform }} ) - - strategy: - matrix: - os: - - windows-2022 - platform: - # For presubmit, just build / test the most common platform - - x64 - - runs-on: ${{ matrix.os }} - - steps: - - - uses: actions/checkout@v4 - with: - submodules: 'recursive' - - - name: Get C library hash - id: get-c-lib-hash - run: - echo "::set-output name=hash::$(git -C google_crc32c log -n 1 --pretty=%H)" - - - id: load-cache - name: Load cached C library - uses: actions/cache@v3 - with: - path: ${{ github.workspace }}\usr - key: - libcrc32c-${{ matrix.os }}-${{ matrix.platform }}-${{ steps.get-c-lib-hash.outputs.hash }} - - - name: Build C Library - if: steps.load-cache.outputs.cache-hit != 'true' - run: | - echo "::group::Install cmake" - python -m pip install --upgrade setuptools pip wheel - python -m pip install cmake - echo "::endgroup::" - echo "::group::Run cmake to initialze build tree" - cmake -S google_crc32c -B build -G "Visual Studio 17 2022" -A ${{ matrix.platform }} -DCRC32C_BUILD_BENCHMARKS=no -DCRC32C_BUILD_TESTS=no -DBUILD_SHARED_LIBS=no -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=yes -DCRC32C_USE_GLOG=0 - echo "::endgroup::" - echo "::group::Run cmake to build library" - cmake --build build --verbose --config Release - echo "::endgroup::" - echo "::group::Run cmake to install library" - cmake --install build --verbose --config Release --prefix=${{ github.workspace }}\usr\ - echo "::endgroup::" - - # Passing through ${{ github.workspace }} to CIBW_ENVIRONMENT mangles - # backslashes: compute a variant which uses only forward-slashses. - - id: crc32c-install-prefix - name: Dead-reckon a CIBW-compatible install prefix - shell: bash - run: | - python -c "import os; workspace = '/'.join(os.getenv('GITHUB_WORKSPACE').split(os.sep)); pfx = f'{workspace}/usr'; print(f'::set-output name=prefix::{pfx}')" - - - id: platform-arch - name: Map platform -> wheel arch - shell: bash - run: | - if [[ "${{ matrix.platform }}" == "Win32" ]]; then - echo "::set-output name=arch::x86" - else - echo "::set-output name=arch::AMD64" - fi - - - name: Build Wheels - uses: pypa/cibuildwheel@v2.20.0 - env: - CIBW_ARCHS_WINDOWS: ${{ steps.platform-arch.outputs.arch }} - # For presubmit, skip build / test for pypy - CIBW_SKIP: pp37* - CIBW_ENVIRONMENT: CRC32C_PURE_PYTHON="0" CRC32C_INSTALL_PREFIX="${{ steps.crc32c-install-prefix.outputs.prefix }}" - CIBW_BUILD_VERBOSITY: 3 - CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: py.test -v {project}/tests