Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nickjiang2378 committed Sep 2, 2024
2 parents 97abb81 + 0750117 commit 53ed763
Show file tree
Hide file tree
Showing 735 changed files with 39,689 additions and 12,723 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
rustflags = [
"-Zproc-macro-backtrace",
"-Wunused_qualifications",
"-Wclippy::upper_case_acronyms",
# Flag to make build.rs scripts generate docs. Should only be used in this repository
# internally, not by dependants.
'--cfg=HYDROFLOW_GENERATE_DOCS',
Expand All @@ -10,6 +11,9 @@ rustflags = [
# "-Aclippy::uninlined-format-args",
]

[target.x86_64-apple-darwin]
linker = "rust-lld"

[target.x86_64-unknown-linux-musl]
linker = "rust-lld"

Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ on:
push:
branches:
- main
- feature/**
tags:
- 'hydro_cli-v[0-9]+.[0-9]+.[0-9]+'

env:
PACKAGE_NAME: hydro_deploy
PYTHON_VERSION: "3.7" # to build abi3 wheels
PYTHON_VERSION: "3.10" # to build abi3 wheels

# based on Ruff's CI
jobs:
Expand All @@ -33,16 +34,17 @@ jobs:
- universal2-apple-darwin
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
- name: "Build wheels"
uses: PyO3/maturin-action@v1
with:
working-directory: hydro_deploy/hydro_cli
target: ${{ matrix.target }}
args: --release --out dist
env:
CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER: clang
- name: "Install built wheel"
run: |
pip install hydro_deploy/hydro_cli/dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall
Expand All @@ -63,7 +65,7 @@ jobs:
- i686-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: x64
Expand Down Expand Up @@ -108,7 +110,7 @@ jobs:
arch: armv7
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: "Build wheels"
Expand Down Expand Up @@ -139,7 +141,7 @@ jobs:
arch: x64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.platform.arch }}
Expand Down Expand Up @@ -173,7 +175,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
- name: "Publish to PyPi"
env:
TWINE_USERNAME: __token__
Expand Down
58 changes: 23 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: CI

on:
push:
branches: [main]
branches:
- main
- feature/**
pull_request:
schedule:
- cron: "35 03 * * *" # Daily at 8:35 PM PDT, 7:35 PM PST.
Expand All @@ -27,7 +29,7 @@ jobs:
check:
name: Lint and Check
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 15
timeout-minutes: 20
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -63,38 +65,28 @@ jobs:

- name: Run sccache-cache
if: matrix.rust_release == 'pinned-nightly'
uses: mozilla-actions/sccache-action@v0.0.3
uses: mozilla-actions/sccache-action@v0.0.4

- name: Set Rust caching env vars
if: matrix.rust_release == 'pinned-nightly'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
uses: actions/github-script@v6
with:
script: |
core.exportVariable('SCCACHE_GHA_ENABLED', 'true');
core.exportVariable('RUSTC_WRAPPER', 'sccache');
- name: Run cargo fmt
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

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

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --features python
run: cargo check --all-targets --features python

- name: Run cargo check (no default features)
uses: actions-rs/cargo@v1
with:
command: check
args: --all-targets --no-default-features
run: cargo check --all-targets --no-default-features

check-wasm:
name: Check WebAssembly
Expand Down Expand Up @@ -133,7 +125,7 @@ jobs:
test:
name: Test Suite
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 25
timeout-minutes: 35
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -169,13 +161,15 @@ jobs:

- name: Run sccache-cache
if: matrix.rust_release == 'pinned-nightly'
uses: mozilla-actions/sccache-action@v0.0.3
uses: mozilla-actions/sccache-action@v0.0.4

- name: Set Rust caching env vars
if: matrix.rust_release == 'pinned-nightly'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
uses: actions/github-script@v6
with:
script: |
core.exportVariable('SCCACHE_GHA_ENABLED', 'true');
core.exportVariable('RUSTC_WRAPPER', 'sccache');
- name: Install cargo-nextest (linux)
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand All @@ -187,16 +181,10 @@ jobs:
run: curl -LsSf https://get.nexte.st/latest/windows-tar | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin

- name: Run cargo nextest on all targets
uses: actions-rs/cargo@v1
with:
command: nextest
args: run --no-fail-fast --features python --all-targets
run: cargo nextest run --no-fail-fast --features python --all-targets

- name: Run doctests
uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --features python --doc
run: cargo test --no-fail-fast --features python --doc

- name: Install Python
uses: actions/setup-python@v4
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/conventional_commits.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
name: Conventional Commits

on:
pull_request:
branches: [ main ]
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
build:
main:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: webiny/action-conventional-commits@v1.1.0
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/examples-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ name: examples-container-build

on:
push:
branches: [main]
branches:
- main
- feature/**

jobs:
pre_job:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
# https://github.com/orgs/community/discussions/25305#discussioncomment-8256560
# Unfortunately branch protection means that this workflow can't push the updated changelogs
# and tags to `main` in the normal way. Instead we have an app:
# https://github.com/organizations/hydro-project/settings/apps/hydro-project-bot
Expand All @@ -35,10 +36,10 @@ jobs:
# `APP_PRIVATE_KEY` ("Generate a private key").
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- run: |
echo "Version bump: $BUMP"
Expand All @@ -54,7 +55,7 @@ jobs:
git config --global user.email "132423234+hydro-project-bot[bot]@users.noreply.github.com"
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Fetch all commit history so smart-release can generate changelogs.
fetch-depth: 0
Expand Down Expand Up @@ -87,9 +88,12 @@ jobs:
${{ inputs.execute && '--execute' || '--no-publish' }}
hydroflow hydroflow_lang hydroflow_macro hydroflow_plus
hydroflow_datalog hydroflow_datalog_core
hydro_deploy hydro_cli hydroflow_cli_integration
hydroflow_plus_cli_integration
hydro_deploy hydro_cli hydroflow_deploy_integration
hydroflow_plus_deploy
stageleft stageleft_macro stageleft_tool
multiplatform_test
env:
# Make sure to set this so the `gh` CLI works using our token.
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
# Show `cargo-smart-release`'s stack trace on error.
RUST_BACKTRACE: 1
Loading

0 comments on commit 53ed763

Please sign in to comment.