Skip to content

Commit

Permalink
Merge 0bfc0da into sapling-pr-archive-shadaj
Browse files Browse the repository at this point in the history
  • Loading branch information
shadaj authored Jan 4, 2024
2 parents 53521da + 0bfc0da commit 816af10
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 133 deletions.
166 changes: 66 additions & 100 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,28 @@ jobs:
cancel_others: "true"

check:
name: Check
name: Lint and Check
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 10
timeout-minutes: 15
needs: pre_job
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
rust_release: [pinned-nightly, latest-nightly]
exclude:
# For non-pull requests, event_name != 'pull_request' will be true,
# and nothing is truthy, so the entire && operator will resolve to
# 'nothing'. Then the || operator will resolve to 'nothing' so we
# will exclude 'nothing'. https://stackoverflow.com/a/73822998
# For non-pull requests, event_name != 'pull_request' will be true, and 'nothing' is
# truthy, so the entire && operator will resolve to 'nothing'. Then the || operator will
# resolve to 'nothing' so we will exclude 'nothing'. https://stackoverflow.com/a/73822998
- rust_release: ${{ (needs.pre_job.outputs.should_skip != 'true' && 'nothing') || 'pinned-nightly' }}
- rust_release: ${{ (github.event_name != 'pull_request' && 'nothing') || 'latest-nightly' }}
- os: ${{ (github.event_name != 'pull_request' && 'nothing') || 'windows-latest' }}

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

steps:
- name: Checkout sources
Expand All @@ -52,6 +59,21 @@ jobs:
toolchain: nightly
override: ${{ matrix.rust_release == 'latest-nightly' }}

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --features python -- -D warnings

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
Expand All @@ -74,10 +96,9 @@ jobs:
matrix:
rust_release: [pinned-nightly, latest-nightly]
exclude:
# For non-pull requests, event_name != 'pull_request' will be true,
# and nothing is truthy, so the entire && operator will resolve to
# 'nothing'. Then the || operator will resolve to 'nothing' so we
# will exclude 'nothing'. https://stackoverflow.com/a/73822998
# For non-pull requests, event_name != 'pull_request' will be true, and 'nothing' is
# truthy, so the entire && operator will resolve to 'nothing'. Then the || operator will
# resolve to 'nothing' so we will exclude 'nothing'. https://stackoverflow.com/a/73822998
- rust_release: ${{ (needs.pre_job.outputs.should_skip != 'true' && 'nothing') || 'pinned-nightly' }}
- rust_release: ${{ (github.event_name != 'pull_request' && 'nothing') || 'latest-nightly' }}

Expand All @@ -104,57 +125,24 @@ jobs:
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 25
needs: pre_job
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
target_selection:
- "--lib --bins"
- "--examples"
- "--tests"
- "--benches"
- "--doc"
os: [ubuntu-latest, windows-latest]
rust_release: [pinned-nightly, latest-nightly]
exclude:
# For non-pull requests, event_name != 'pull_request' will be true,
# and nothing is truthy, so the entire && operator will resolve to
# 'nothing'. Then the || operator will resolve to 'nothing' so we
# will exclude 'nothing'. https://stackoverflow.com/a/73822998
# For non-pull requests, event_name != 'pull_request' will be true, and 'nothing' is
# truthy, so the entire && operator will resolve to 'nothing'. Then the || operator will
# resolve to 'nothing' so we will exclude 'nothing'. https://stackoverflow.com/a/73822998
- rust_release: ${{ (needs.pre_job.outputs.should_skip != 'true' && 'nothing') || 'pinned-nightly' }}
- rust_release: ${{ (github.event_name != 'pull_request' && 'nothing') || 'latest-nightly' }}
- os: ${{ (github.event_name != 'pull_request' && 'nothing') || 'windows-latest' }}

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

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: ${{ matrix.rust_release == 'latest-nightly' }}

- name: Run cargo test on target_selection
uses: actions-rs/cargo@v1
with:
command: test
args: --profile cidev --no-fail-fast --features python ${{ matrix.target_selection }}

test-wasm:
name: Test Suite (WebAssembly)
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 15
needs: pre_job
runs-on: ubuntu-latest
strategy:
matrix:
rust_release: [pinned-nightly, latest-nightly]
exclude:
# For non-pull requests, event_name != 'pull_request' will be true,
# and nothing is truthy, so the entire && operator will resolve to
# 'nothing'. Then the || operator will resolve to 'nothing' so we
# will exclude 'nothing'. https://stackoverflow.com/a/73822998
- rust_release: ${{ (needs.pre_job.outputs.should_skip != 'true' && 'nothing') || 'pinned-nightly' }}
- rust_release: ${{ (github.event_name != 'pull_request' && 'nothing') || 'latest-nightly' }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"

steps:
- name: Checkout sources
Expand All @@ -165,43 +153,16 @@ jobs:
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
override: ${{ matrix.rust_release == 'latest-nightly' }}

- name: Get wasm-bindgen version
id: wasm-bindgen-version
run: echo "VERSION=$(cargo pkgid wasm-bindgen-shared | cut -d '@' -f2)" >> "$GITHUB_OUTPUT"
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Install WebAssembly test runner
- name: Run cargo test on all targets
uses: actions-rs/cargo@v1
with:
command: install
args: wasm-bindgen-cli@${{ steps.wasm-bindgen-version.outputs.VERSION }}

- name: Run cargo test
uses: actions-rs/cargo@v1
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner
with:
command: test
args: -p hydroflow --target wasm32-unknown-unknown --tests --no-fail-fast

test-cli:
name: Test CLI
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 25
needs: pre_job
runs-on: ubuntu-latest

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

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
args: --profile cidev --no-fail-fast --features python --all-targets

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -225,20 +186,19 @@ jobs:
pip install -r requirements.txt
RUST_BACKTRACE=1 pytest *.py
lints:
name: Lints
test-wasm:
name: Test Suite (WebAssembly)
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 10
timeout-minutes: 15
needs: pre_job
runs-on: ubuntu-latest
strategy:
matrix:
rust_release: [pinned-nightly, latest-nightly]
exclude:
# For non-pull requests, event_name != 'pull_request' will be true,
# and nothing is truthy, so the entire && operator will resolve to
# 'nothing'. Then the || operator will resolve to 'nothing' so we
# will exclude 'nothing'. https://stackoverflow.com/a/73822998
# For non-pull requests, event_name != 'pull_request' will be true, and 'nothing' is
# truthy, so the entire && operator will resolve to 'nothing'. Then the || operator will
# resolve to 'nothing' so we will exclude 'nothing'. https://stackoverflow.com/a/73822998
- rust_release: ${{ (needs.pre_job.outputs.should_skip != 'true' && 'nothing') || 'pinned-nightly' }}
- rust_release: ${{ (github.event_name != 'pull_request' && 'nothing') || 'latest-nightly' }}

Expand All @@ -251,20 +211,26 @@ jobs:
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
override: ${{ matrix.rust_release == 'latest-nightly' }}
components: rustfmt, clippy

- name: Run cargo fmt
- name: Get wasm-bindgen version
id: wasm-bindgen-version
run: echo "VERSION=$(cargo pkgid wasm-bindgen-shared | cut -d '@' -f2)" >> "$GITHUB_OUTPUT"

- name: Install WebAssembly test runner
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
command: install
args: wasm-bindgen-cli@${{ steps.wasm-bindgen-version.outputs.VERSION }}

- name: Run cargo clippy
- name: Run cargo test
uses: actions-rs/cargo@v1
env:
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: wasm-bindgen-test-runner
with:
command: clippy
args: --all-targets --features python -- -D warnings
command: test
args: -p hydroflow --target wasm32-unknown-unknown --tests --no-fail-fast

build-website:
name: Build Website
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

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

33 changes: 17 additions & 16 deletions hydro_deploy/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,27 @@ documentation = "https://docs.rs/hydro_deploy/"
description = "Hydro Deploy"

[dependencies]
tokio = { version = "1.16", features = [ "full" ] }
tokio-util = { version = "0.7.7", features=[ "compat" ] }
once_cell = "1.17"
anyhow = { version = "1.0.69", features = [ "backtrace" ] }
async-trait = "0.1.64"
async-channel = "1.8.0"
async-once-cell = "0.5.3"
async-process = "1.6.0"
async-recursion = "1"
async-recursion = "1.0"
async-ssh2-lite = { version = "0.4.2", features = [ "tokio" ] }
async-trait = "0.1.64"
bytes = "1.1.0"
cargo_metadata = "0.15.4"
dunce = "1.0.4"
dyn-clone = "1"
futures = "0.3.26"
futures-core = "0.3.26"
async-channel = "1.8.0"
hydroflow_cli_integration = { path = "../hydroflow_cli_integration", version = "^0.3.0" }
indicatif = "0.17.6"
nanoid = "0.4.0"
nix = "0.26.2"
once_cell = "1.17"
serde = { version = "1", features = [ "derive" ] }
serde_json = "1"
tempfile = "3.3.0"
async-ssh2-lite = { version = "0.4.2", features = [ "tokio" ] }
shell-escape = "0.1.5"
dyn-clone = "1"
bytes = "1.1.0"
nanoid = "0.4.0"
nix = "0.26.2"
hydroflow_cli_integration = { path = "../hydroflow_cli_integration", version = "^0.3.0" }
indicatif = "0.17.6"
cargo_metadata = "0.15.4"
async-once-cell = "0.5.3"
tempfile = "3.3.0"
tokio = { version = "1.16", features = [ "full" ] }
tokio-util = { version = "0.7.7", features=[ "compat" ] }
Loading

0 comments on commit 816af10

Please sign in to comment.