Skip to content

Commit

Permalink
Trying to fix the CI but idk (#1430)
Browse files Browse the repository at this point in the history
* add musl to linux install

* github workflows

* added rustls
  • Loading branch information
Haaroon authored Jan 2, 2024
1 parent c382036 commit db09c7c
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 103 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/_release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
matrix:
target: [x86_64, aarch64]
steps:
- name: "Check if user has write access"
uses: "lannonbr/[email protected]"
with:
permission: "write"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: "Check if user has write access"
# uses: "lannonbr/[email protected]"
# with:
# permission: "write"
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
Expand Down Expand Up @@ -54,29 +54,29 @@ jobs:
command: build
target: ${{ matrix.target }}
args: --release --out dist -i python3.7 -i python3.8 -i python3.9 -i python3.10 -i python3.11
manylinux: 2014
manylinux: auto
before-script-linux: |
if [[ -f /etc/os-release ]]; then
. /etc/os-release
case $ID in
ubuntu)
echo "Installing openssl-dev on Ubuntu..."
apt update -y
apt install -y pkg-config libssl-dev libc6 build-essential
apt install -y pkg-config libssl-dev libc6 build-essential musl-tools
;;
arch)
echo "Installing openssl-dev on Arch Linux..."
pacman -Syu --noconfirm pkg-config openssl
pacman -Syu --noconfirm pkg-config openssl musl
;;
fedora)
echo "Installing openssl-dev on Fedora..."
dnf update -y
dnf install -y pkg-config openssl-devel
dnf install -y pkg-config openssl-devel musl
;;
alpine)
echo "Installing openssl-dev on Alpine Linux..."
apk update -y
apk add pkgconfig openssl-dev
apk add pkgconfig openssl-dev musl-dev
;;
centos)
echo "Installing openssl-dev on CentOS..."
Expand Down
178 changes: 89 additions & 89 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
# name: Code Coverage
name: Code Coverage
# on:
# workflow_call:
# inputs:
# skip_tests:
# type: boolean
# default: false
# required: false
# # DO NOT CHANGE NAME OF WORKFLOW, USED IN OTHER WORKFLOWS KEEP "Rust Tests"
# jobs:
# code-coverage:
# if: ${{ !inputs.skip_tests }}
# name: Code Coverage
# runs-on: ubuntu-latest
# env:
# RUSTC_WRAPPER: sccache
# SCCACHE_CACHE_SIZE: 2G
# SCCACHE_DIR: /home/runner/.cache/sccache
# SCCACHE_PATH: /home/runner/.cache/sccache
# steps:
# - uses: actions/checkout@v3
# name: Checkout
# - name: Cache sccache
# uses: actions/cache@v3
# with:
# path: /home/runner/.cache/sccache
# key: codecov-${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# codecov-${{ runner.os }}-sccache-
# - name: Set up cargo cache
# uses: actions/cache@v3
# continue-on-error: false
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/debug
# target/release
# key: codecov-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-coverage
# restore-keys: codecov-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-coverage
# - uses: actions-rs/toolchain@v1
# name: Setup Rust
# with:
# toolchain: nightly
# override: true
# components: rustfmt, clippy
# - name: Install sccache (Ubuntu)
# run: |
# curl -L https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz | tar xz
# sudo mv sccache-v0.5.4-x86_64-unknown-linux-musl/sccache /usr/local/bin/
# - name: Start sccache server
# run: sccache --start-server
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"
# cache: 'pip'
# - name: Run Maturin develop
# uses: PyO3/maturin-action@v1
# with:
# working-directory: ./python
# command: build
# sccache: true
# - name: Install Python dependencies
# run: |
# python -m pip install -q pytest networkx numpy seaborn pandas nbmake pytest-xdist matplotlib pyvis pytest-cov coverage
# python -m pip install target/wheels/raphtory-*.whl
# - name: Run tests (rust)
# run: cargo test -p raphtory --features "io python"
# env:
# CARGO_INCREMENTAL: '0'
# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
# - name: Run tests (python)
# run: cargo test -p raphtory-pymodule --no-default-features
# env:
# CARGO_INCREMENTAL: '0'
# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
# - id: coveragerust
# name: Run rust tests (rust-grcov) and collect coverage
# uses: actions-rs/[email protected]
# - name: Run python tests and collect coverage
# run: cd python/tests && pytest --cov=./ --cov-report=xml
# - name: Codecov
# uses: codecov/[email protected]
# with:
# verbose: true
# fail_ci_if_error: false
# files: ./coverage.xml, ${{ steps.coveragerust.outputs.report }}
# - name: Print sccache stats
# run: sccache --show-stats
# - name: Stop sccache server
# run: sccache --stop-server || true
# DO NOT CHANGE NAME OF WORKFLOW, USED IN OTHER WORKFLOWS KEEP "Rust Tests"
jobs:
code-coverage:
if: ${{ !inputs.skip_tests }}
name: Code Coverage
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
SCCACHE_PATH: /home/runner/.cache/sccache
steps:
- uses: actions/checkout@v3
name: Checkout
- name: Cache sccache
uses: actions/cache@v3
with:
path: /home/runner/.cache/sccache
key: codecov-${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
codecov-${{ runner.os }}-sccache-
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/debug
target/release
key: codecov-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-coverage
restore-keys: codecov-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-coverage
- uses: actions-rs/toolchain@v1
name: Setup Rust
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Install sccache (Ubuntu)
run: |
curl -L https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv sccache-v0.5.4-x86_64-unknown-linux-musl/sccache /usr/local/bin/
- name: Start sccache server
run: sccache --start-server
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
- name: Run Maturin develop
uses: PyO3/maturin-action@v1
with:
working-directory: ./python
command: build
sccache: true
- name: Install Python dependencies
run: |
python -m pip install -q pytest networkx numpy seaborn pandas nbmake pytest-xdist matplotlib pyvis pytest-cov coverage
python -m pip install target/wheels/raphtory-*.whl
- name: Run tests (rust)
run: cargo test -p raphtory --features "io python"
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
- name: Run tests (python)
run: cargo test -p raphtory-pymodule --no-default-features
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
- id: coveragerust
name: Run rust tests (rust-grcov) and collect coverage
uses: actions-rs/[email protected]
- name: Run python tests and collect coverage
run: cd python/tests && pytest --cov=./ --cov-report=xml
- name: Codecov
uses: codecov/[email protected]
with:
verbose: true
fail_ci_if_error: false
files: ./coverage.xml, ${{ steps.coveragerust.outputs.report }}
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true

44 changes: 41 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions raphtory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ num = {version="0.4.0", optional=true}
display-error-chain = {version= "0.2.0", optional=true}
arrow2 = {version="0.17", optional=true}
kdam = { version="0.5.0", features = ["notebook"], optional = true}
rustls = "0.22.1"


[dev-dependencies]
Expand Down

0 comments on commit db09c7c

Please sign in to comment.