Skip to content

Commit

Permalink
dynamic composite conditions testing
Browse files Browse the repository at this point in the history
  • Loading branch information
nitzmahone committed May 13, 2024
1 parent 9004f40 commit 3570acb
Showing 1 changed file with 100 additions and 100 deletions.
200 changes: 100 additions & 100 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
env:
LIBYAML_REPO: https://github.com/yaml/libyaml
LIBYAML_REF: 0.2.5
skip_ci_redundant_jobs: true # ${{ github.event_name == 'pull_request' }}
skip_slow_jobs: true # ${{ github.event_name == 'pull_request' }}
skip_ci_redundant_jobs: blorp_redun # ${{ github.event_name == 'pull_request' }}
skip_slow_jobs: blorp_skipslow # ${{ github.event_name == 'pull_request' }}
skip_artifact_upload: true # ${{ github.event_name == 'pull_request' }}

jobs:
Expand Down Expand Up @@ -65,51 +65,51 @@ jobs:
# name: dist
# path: dist/*.tar.gz


linux_libyaml:
name: libyaml ${{matrix.cfg.arch}} ${{matrix.cfg.platform}}
runs-on: ubuntu-22.04
strategy:
matrix:
cfg:
- { platform: manylinux1, arch: x86_64 }
- { platform: manylinux2014, arch: x86_64 }
- { platform: manylinux2014, arch: aarch64 }
- { platform: manylinux2014, arch: s390x }
- { platform: musllinux_1_1, arch: x86_64 }
env:
DOCKER_IMAGE: quay.io/pypa/${{matrix.cfg.platform}}_${{matrix.cfg.arch}}
steps:
- name: Check cached libyaml state
id: cached_libyaml
uses: actions/cache@v3
with:
path: libyaml
key: libyaml_${{matrix.cfg.platform}}_${{matrix.cfg.arch}}_${{env.LIBYAML_REF}}

- name: configure docker foreign arch support
uses: docker/setup-qemu-action@v2
if: matrix.cfg.arch != 'x86_64' && steps.cached_libyaml.outputs.cache-hit != 'true'

- name: Checkout pyyaml
uses: actions/checkout@v3
if: steps.cached_libyaml.outputs.cache-hit != 'true'

- name: Build libyaml
run: >
docker run --rm
--volume "$(pwd):/io"
--env LIBYAML_REF
--env LIBYAML_REPO
--workdir /io
"$DOCKER_IMAGE"
/io/packaging/build/libyaml.sh
if: steps.cached_libyaml.outputs.cache-hit != 'true'

- name: ensure output is world readable (or cache fill fails with Permission Denied)
run: >
sudo chmod -R a+r ./libyaml/
if: steps.cached_libyaml.outputs.cache-hit != 'true'
#
# linux_libyaml:
# name: libyaml ${{matrix.cfg.arch}} ${{matrix.cfg.platform}}
# runs-on: ubuntu-22.04
# strategy:
# matrix:
# cfg:
# - { platform: manylinux1, arch: x86_64 }
# - { platform: manylinux2014, arch: x86_64 }
# - { platform: manylinux2014, arch: aarch64 }
# - { platform: manylinux2014, arch: s390x }
# - { platform: musllinux_1_1, arch: x86_64 }
# env:
# DOCKER_IMAGE: quay.io/pypa/${{matrix.cfg.platform}}_${{matrix.cfg.arch}}
# steps:
# - name: Check cached libyaml state
# id: cached_libyaml
# uses: actions/cache@v3
# with:
# path: libyaml
# key: libyaml_${{matrix.cfg.platform}}_${{matrix.cfg.arch}}_${{env.LIBYAML_REF}}
#
# - name: configure docker foreign arch support
# uses: docker/setup-qemu-action@v2
# if: matrix.cfg.arch != 'x86_64' && steps.cached_libyaml.outputs.cache-hit != 'true'
#
# - name: Checkout pyyaml
# uses: actions/checkout@v3
# if: steps.cached_libyaml.outputs.cache-hit != 'true'
#
# - name: Build libyaml
# run: >
# docker run --rm
# --volume "$(pwd):/io"
# --env LIBYAML_REF
# --env LIBYAML_REPO
# --workdir /io
# "$DOCKER_IMAGE"
# /io/packaging/build/libyaml.sh
# if: steps.cached_libyaml.outputs.cache-hit != 'true'
#
# - name: ensure output is world readable (or cache fill fails with Permission Denied)
# run: >
# sudo chmod -R a+r ./libyaml/
# if: steps.cached_libyaml.outputs.cache-hit != 'true'

make_linux_pyyaml_matrix:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -148,59 +148,59 @@ jobs:
- { platform: musllinux_1_1, arch: x86_64, spec: cp312, omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} }
- { platform: musllinux_1_1, arch: x86_64, spec: cp313, cibw_version: "https://github.com/nitzmahone/cibuildwheel/archive/refs/heads/py313_support.zip", omit: ${{ env.skip_ci_redundant_jobs || env.skip_slow_jobs }} }
linux_pyyaml:
needs: [linux_libyaml, make_linux_pyyaml_matrix]
name: pyyaml ${{matrix.arch}} ${{matrix.platform}} ${{matrix.spec}}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.make_linux_pyyaml_matrix.outputs.matrix_json) }}

steps:
- name: Checkout PyYAML
uses: actions/checkout@v3

- name: Fetch cached libyaml
id: cached_libyaml
uses: actions/cache/restore@v3
with:
path: libyaml
key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}}
fail-on-cache-miss: true

- name: configure docker foreign arch support
uses: docker/setup-qemu-action@v2
if: matrix.arch != 'x86_64'

- name: Build/Test/Package
env:
CIBW_ARCHS: all
# HACK: ick, maybe deconstruct the matrix a bit or query cibuildwheel for its default target *linux spec first?
CIBW_BUILD: ${{matrix.spec}}-${{ contains(matrix.platform, 'musllinux') && 'musllinux' || 'manylinux' }}_${{matrix.arch}}
CIBW_BUILD_VERBOSITY: 1
# containerized Linux builds require explicit CIBW_ENVIRONMENT
CIBW_ENVIRONMENT: >
C_INCLUDE_PATH=libyaml/include
LIBRARY_PATH=libyaml/src/.libs
LD_LIBRARY_PATH=libyaml/src/.libs
PYYAML_FORCE_CYTHON=1
PYYAML_FORCE_LIBYAML=1
CIBW_TEST_COMMAND: cd {project}; pytest
CIBW_TEST_REQUIRES: pytest
run: |
set -eux
python3 -V
python3 -m pip install -U --user ${{ matrix.cibw_version || 'cibuildwheel' }}
python3 -m cibuildwheel --platform auto --output-dir dist .
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.whl
if-no-files-found: error
if: ${{ ! env.skip_artifact_upload }}
#
# linux_pyyaml:
# needs: [linux_libyaml, make_linux_pyyaml_matrix]
# name: pyyaml ${{matrix.arch}} ${{matrix.platform}} ${{matrix.spec}}
# runs-on: ubuntu-22.04
# strategy:
# fail-fast: false
# matrix: ${{ fromJSON(needs.make_linux_pyyaml_matrix.outputs.matrix_json) }}
#
# steps:
# - name: Checkout PyYAML
# uses: actions/checkout@v3
#
# - name: Fetch cached libyaml
# id: cached_libyaml
# uses: actions/cache/restore@v3
# with:
# path: libyaml
# key: libyaml_${{matrix.platform}}_${{matrix.arch}}_${{env.LIBYAML_REF}}
# fail-on-cache-miss: true
#
# - name: configure docker foreign arch support
# uses: docker/setup-qemu-action@v2
# if: matrix.arch != 'x86_64'
#
# - name: Build/Test/Package
# env:
# CIBW_ARCHS: all
# # HACK: ick, maybe deconstruct the matrix a bit or query cibuildwheel for its default target *linux spec first?
# CIBW_BUILD: ${{matrix.spec}}-${{ contains(matrix.platform, 'musllinux') && 'musllinux' || 'manylinux' }}_${{matrix.arch}}
# CIBW_BUILD_VERBOSITY: 1
# # containerized Linux builds require explicit CIBW_ENVIRONMENT
# CIBW_ENVIRONMENT: >
# C_INCLUDE_PATH=libyaml/include
# LIBRARY_PATH=libyaml/src/.libs
# LD_LIBRARY_PATH=libyaml/src/.libs
# PYYAML_FORCE_CYTHON=1
# PYYAML_FORCE_LIBYAML=1
# CIBW_TEST_COMMAND: cd {project}; pytest
# CIBW_TEST_REQUIRES: pytest
# run: |
# set -eux
# python3 -V
# python3 -m pip install -U --user ${{ matrix.cibw_version || 'cibuildwheel' }}
# python3 -m cibuildwheel --platform auto --output-dir dist .
#
# - name: Upload artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist
# path: dist/*.whl
# if-no-files-found: error
# if: ${{ ! env.skip_artifact_upload }}
#
# macos_libyaml:
# name: libyaml macos ${{matrix.arch}}
Expand Down

0 comments on commit 3570acb

Please sign in to comment.