Skip to content

Commit

Permalink
Update CI - Try ubicloud for linux builds (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored Mar 3, 2024
1 parent 1be6d13 commit 2e60843
Showing 1 changed file with 17 additions and 57 deletions.
74 changes: 17 additions & 57 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,32 @@ on:

jobs:
macos:
runs-on: macos-latest
runs-on: macos-13
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Build
run: cargo build --release
- 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 python --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
- name: Install built wheels - x86_64
run: |
Expand All @@ -53,11 +44,13 @@ jobs:
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-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
- name: Install built wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11", "3.12"]'), matrix.python-version) }}
Expand Down Expand Up @@ -85,36 +78,26 @@ jobs:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
if: matrix.target == 'x64'
run: cargo build --release
- name: Tests
if: matrix.target == 'x64'
run: cargo test --no-default-features --release
- name: Build wheels - cramjam-python
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
sccache: true
args: -i python --release --out dist --manifest-path cramjam-python/Cargo.toml
- name: Build wheels - cramjam-cli
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
sccache: true
args: -i python --release --out dist --manifest-path cramjam-cli/Cargo.toml
- name: Install built wheel
run: |
Expand All @@ -133,26 +116,15 @@ jobs:
path: dist

linux:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-2
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
target: [x86_64, i686]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Tests
run: cargo test --no-default-features --release --features capi
- uses: actions/setup-python@v5
Expand All @@ -165,12 +137,14 @@ jobs:
with:
target: ${{ matrix.target }}
manylinux: auto
sccache: true
args: -i ${{ matrix.python-version }} --release --out dist --manifest-path cramjam-python/Cargo.toml
- name: Build Wheels - cramjam-cli
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
sccache: true
args: -i ${{ matrix.python-version }} --release --out dist --manifest-path cramjam-cli/Cargo.toml
- name: Python UnitTest - cramjam-python
if: matrix.target == 'x86_64'
Expand All @@ -189,7 +163,7 @@ jobs:
path: dist

linux-cross:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-4
strategy:
matrix:
python:
Expand All @@ -207,25 +181,18 @@ jobs:
target: aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build Wheels cramjam-python
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
sccache: true
manylinux: auto
args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-python/Cargo.toml
- name: Build Wheels cramjam-cli
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
sccache: true
manylinux: auto
args: -i ${{ matrix.python }} --release --out dist --manifest-path cramjam-cli/Cargo.toml
- uses: uraimo/run-on-arch-action@v2.3.0
Expand Down Expand Up @@ -266,9 +233,9 @@ jobs:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
- os: ubicloud-standard-2
flags: ''
- os: macos-latest
- os: macos-13
flags: ''
- os: windows-latest
flags: '--features generate-import-lib'
Expand All @@ -277,28 +244,21 @@ jobs:
- pypy-3.10
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{matrix.python}}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Build Wheels - cramjam-python
uses: PyO3/maturin-action@v1
with:
manylinux: auto
sccache: true
args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-python/Cargo.toml
- name: Build Wheels - cramjam-cli
if: ${{ matrix.platform.os != 'windows-latest' }}
uses: PyO3/maturin-action@v1
with:
manylinux: auto
sccache: true
args: -i ${{ matrix.python }} --release ${{ matrix.platform.flags }} --out dist --manifest-path cramjam-cli/Cargo.toml
- name: cramjam test
# TODO: I'm not sure but the actual collection of tests on windows using pypy3.10 takes forever and/or fails
Expand Down

0 comments on commit 2e60843

Please sign in to comment.