From 977a42a3649f09a43e88e293f89395797cfd9dcc Mon Sep 17 00:00:00 2001 From: Miles Granger Date: Thu, 21 Mar 2024 06:45:46 +0100 Subject: [PATCH] try again --- .github/workflows/CI.yml | 64 ++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 43260453..245897dc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -32,25 +32,27 @@ jobs: targets: aarch64-apple-darwin - name: Install packages (macOS) run: brew install ninja - - name: Tests - shell: bash -el {0} + - name: Set Env vars run: | - echo $CONDA_PREFIX - DYLD_FALLBACK_LIBRARY_PATH=$CONDA_PREFIX/lib cargo test --no-default-features --release + echo 'PYO3_PYTHON=$(which python)' >> GITHUB_ENV + echo 'PYO3_CROSS_LIB_DIR=$CONDA_PREFIX/lib' >> GITHUB_ENV + echo 'PYO3_CROSS_PYTHON_VERSION=${{ matrix.python-version }}' + echo 'DYLD_FALLBACK_LIBRARY_PATH=$CONDA_PREFIX/lib' + - name: Tests + run: cargo test --no-default-features --release - name: Build wheels - x86_64 - cramjam-cli uses: PyO3/maturin-action@v1 with: target: x86_64 sccache: true - args: -i $(which python) --release --out dist --sdist --manifest-path cramjam-cli/Cargo.toml + args: --release --out dist --sdist --manifest-path cramjam-cli/Cargo.toml - name: Build wheels - x86_64 - cramjam-python uses: PyO3/maturin-action@v1 with: target: x86_64 sccache: true - args: -i python --release --out dist --sdist --manifest-path cramjam-python/Cargo.toml + args: --release --out dist --sdist --manifest-path cramjam-python/Cargo.toml - name: Install built wheels - x86_64 - shell: bash -el {0} run: | pip install cramjam --pre --no-index --find-links dist --force-reinstall pip install cramjam-cli --pre --no-index --find-links dist --force-reinstall @@ -59,28 +61,23 @@ jobs: uses: PyO3/maturin-action@v1 with: sccache: true - args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml + args: --release --target universal2-apple-darwin --out dist --manifest-path cramjam-cli/Cargo.toml - name: Build wheels - universal2 if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }} uses: PyO3/maturin-action@v1 with: sccache: true - args: -i python --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml + args: --release --target universal2-apple-darwin --out dist --manifest-path cramjam-python/Cargo.toml - name: Install built wheels - universal2 - shell: bash -el {0} if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }} run: | pip install cramjam --pre --no-index --find-links dist --force-reinstall pip install cramjam-cli --pre --no-index --find-links dist --force-reinstall - - name: Python UnitTest - cramjam-cli - shell: bash -el {0} - run: | pip install pytest numpy hypothesis - python -m pytest cramjam-cli -vs --ignore **/benchmarks + - name: Python UnitTest - cramjam-cli + run: python -m pytest cramjam-cli -vs --ignore **/benchmarks - name: Python UnitTest - cramjam-python - shell: bash -el {0} - run: | - python -m pytest cramjam-python -vs --ignore **/benchmarks + run: python -m pytest cramjam-python -vs --ignore **/benchmarks - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -133,22 +130,37 @@ jobs: # path: dist # linux: - # runs-on: ubicloud-standard-2 + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash -el {0} # strategy: # matrix: - # python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - # target: [x86_64, i686] + # python-version: + # # - '3.7' + # # - '3.8' + # # - '3.9' + # # - '3.10' + # # - '3.11' + # - '3.12' + # target: + # - x86_64 + # # - i686 # steps: # - uses: actions/checkout@v3 + # - uses: conda-incubator/setup-miniconda@v3 + # with: + # python-version: ${{ matrix.python-version }} + # miniconda-version: "latest" + # channels: conda-forge,defaults + # channel-priority: true + # activate-environment: cramjam + # environment-file: environment.yml # - name: Install Rust toolchain # uses: dtolnay/rust-toolchain@stable - # - name: Install build stuff - # run: sudo apt update && sudo apt install build-essential -y # - name: Tests - # run: cargo test --no-default-features --release --features capi - # - uses: actions/setup-python@v5 - # with: - # python-version: ${{ matrix.python-version }} + # run: + # LD_LIBRARY_PATH=$CONDA_PREFIX/lib cargo test --no-default-features --release # - name: Audit # run: cargo install cargo-audit && cargo audit # - name: Build Wheels - cramjam-python