Skip to content

Commit

Permalink
Merge pull request #66 from jinlow/code-speed-up-runner
Browse files Browse the repository at this point in the history
Code speed up runner
  • Loading branch information
jinlow authored Aug 26, 2023
2 parents 145f705 + 7694dd8 commit ecafdaa
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 45 deletions.
86 changes: 41 additions & 45 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
command: build
Expand All @@ -44,13 +43,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
args: --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }} --interpreter python --skip-existing --manifest-path py-forust/Cargo.toml
Expand All @@ -61,29 +60,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
command: build
Expand All @@ -97,13 +95,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
target: x86_64
Expand All @@ -116,29 +114,28 @@ jobs:
pyversion: ["3.8", "3.9", "3.10", "3.11"]
# target: [x86_64, i686]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- name: Build Wheels with maturin
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
target: x86_64
manylinux: auto
Expand All @@ -153,13 +150,13 @@ jobs:
pytest tests
cd ..
- name: Save Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
with:
command: publish
target: x86_64
Expand All @@ -169,27 +166,26 @@ jobs:
cargo-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- name: Install deps
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn
run: pip install numpy pandas seaborn xgboost=='1.6.1' scikit-learn toml
- run: |
cp README.md py-forust/README.md
cp LICENSE py-forust/LICENSE
- name: Update TOML
run: python scripts/remove-optional-deps.py
- name: Build test data
run: python scripts/make_resources.py
- name: Run Cargo tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Run tests
run: cargo test --verbose
- if: "startsWith(github.ref, 'refs/tags/')"
name: Publish Crate
run: cargo publish --token ${CRATES_TOKEN}
Expand Down
18 changes: 18 additions & 0 deletions scripts/remove-optional-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Building with polars is sooo slow.
# It's only there for the example, so let's remove it
# in the regular build process.
# Requires toml package
import shutil

import toml

ct = toml.load("Cargo.toml")

del ct["dev-dependencies"]
del ct["bench"]

with open("Cargo.toml", "w") as file:
toml.dump(ct, file)

# Also delete the rust example.
shutil.rmtree("examples")

0 comments on commit ecafdaa

Please sign in to comment.