-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: consolidate tasks and use sccache and nextest
- Loading branch information
Showing
12 changed files
with
128 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[test-groups] | ||
serial-integration = { max-threads = 1 } | ||
|
||
[[profile.default.overrides]] | ||
filter = 'binary(deadlock_detector)' | ||
test-group = 'serial-integration' | ||
|
||
[[profile.default.overrides]] | ||
filter = 'binary(two_pc)' | ||
test-group = 'serial-integration' | ||
|
||
[[profile.default.overrides]] | ||
filter = 'binary(kvs)' | ||
test-group = 'serial-integration' | ||
|
||
[[profile.default.overrides]] | ||
filter = 'binary(kvs_replicated)' | ||
test-group = 'serial-integration' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ 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: 15 | ||
needs: pre_job | ||
|
@@ -40,7 +40,15 @@ jobs: | |
# 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" | ||
CARGO_PROFILE_DEV_STRIP: "debuginfo" | ||
CARGO_PROFILE_TEST_STRIP: "debuginfo" | ||
CARGO_PROFILE_RELEASE_STRIP: "debuginfo" | ||
|
||
steps: | ||
- name: Checkout sources | ||
|
@@ -53,6 +61,22 @@ jobs: | |
toolchain: nightly | ||
override: ${{ matrix.rust_release == 'latest-nightly' }} | ||
|
||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Run cargo fmt | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
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: | ||
|
@@ -108,12 +132,6 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
target_selection: | ||
- "--lib --bins" | ||
- "--examples" | ||
- "--tests" | ||
- "--benches" | ||
- "--doc" | ||
rust_release: [pinned-nightly, latest-nightly] | ||
exclude: | ||
# For non-pull requests, event_name != 'pull_request' will be true, and 'nothing' is | ||
|
@@ -123,6 +141,15 @@ jobs: | |
- 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" | ||
CARGO_PROFILE_DEV_STRIP: "debuginfo" | ||
CARGO_PROFILE_TEST_STRIP: "debuginfo" | ||
CARGO_PROFILE_RELEASE_STRIP: "debuginfo" | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
@@ -134,101 +161,75 @@ jobs: | |
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 }} | ||
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
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' }} | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- name: Install cargo-nextest (linux) | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | ||
|
||
- name: Install nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
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: Install cargo-nextest (windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
shell: bash | ||
run: curl -LsSf https://get.nexte.st/latest/windows-tar | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin | ||
|
||
- name: Install WebAssembly test runner | ||
- name: Run cargo nextest on all targets | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: wasm-bindgen-cli@${{ steps.wasm-bindgen-version.outputs.VERSION }} | ||
command: nextest | ||
args: run --no-fail-fast --features python --all-targets | ||
|
||
- name: Run cargo test | ||
- name: Run doctests | ||
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: --no-fail-fast --features python --doc | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Build CLI | ||
- name: Build CLI (Linux) | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
cd hydro_deploy/hydro_cli | ||
python -m venv .venv | ||
source .venv/bin/activate | ||
pip install maturin | ||
maturin develop | ||
- name: Build CLI (Windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
cd hydro_deploy/hydro_cli | ||
python -m venv .venv | ||
.venv/Scripts/activate | ||
pip install maturin | ||
maturin develop | ||
- name: Run Python tests | ||
- name: Run Python tests (Linux) | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
ulimit -c unlimited | ||
cd hydro_deploy/hydro_cli | ||
source .venv/bin/activate | ||
cd python_tests | ||
pip install -r requirements.txt | ||
RUST_BACKTRACE=1 pytest *.py | ||
RUST_BACKTRACE=1 pytest | ||
- name: Run Python tests (Windows) | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
run: | | ||
cd hydro_deploy/hydro_cli | ||
.venv/Scripts/activate | ||
cd python_tests | ||
pip install -r requirements.txt | ||
pytest | ||
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: | ||
|
@@ -250,20 +251,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 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.