-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb1c174
commit b6855ce
Showing
28 changed files
with
284 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../config.toml |
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,47 @@ | ||
name: 'Setup Rust' | ||
description: 'Toolchain setup and Initial compilation' | ||
inputs: | ||
rye-version: | ||
description: 'Rye version to use' | ||
required: true | ||
default: '0.16.0' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Rye Cache | ||
id: rye-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.rye | ||
key: "rye-${{ runner.os }}-${{ inputs.rye-version }}" | ||
|
||
- name: Rye Install | ||
shell: bash | ||
run: curl -sSf https://rye-up.com/get | bash | ||
if: steps.rye-cache.outputs.cache-hit != 'true' | ||
env: | ||
RYE_VERSION: "${{ inputs.rye-version }}" | ||
RYE_INSTALL_OPTION: "--yes" | ||
|
||
- name: Rye Shims | ||
shell: bash | ||
run: echo "~/.rye/shims" >> $GITHUB_PATH | ||
|
||
- name: Venv Cache | ||
id: venv-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: "venv-${{ runner.os }}-${{ hashFiles('requirements**.lock') }}" | ||
|
||
- name: Rye Sync | ||
shell: bash | ||
# --no-lock prevents resolution of the lock file. The locks are still respected. | ||
# We always run `rye sync` even if the cache fetch was successful since it builds our Rust extensions for us. | ||
run: rye sync --no-lock | ||
env: | ||
MATURIN_PEP517_ARGS: "--profile dev" | ||
|
||
- name: Export Path | ||
shell: bash | ||
run: echo "PATH=$PATH" >> $GITHUB_ENV |
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,44 @@ | ||
name: 'Setup Rust' | ||
description: 'Toolchain setup and Initial compilation' | ||
inputs: | ||
rust-toolchain: # id of input | ||
description: 'Rust toolchain version to use' | ||
required: true | ||
default: stable | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Rust Toolchain Cache | ||
id: rustup-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.rustup | ||
key: "rustup-${{ runner.os }}-${{ inputs.rust-toolchain }}" | ||
|
||
- name: Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
if: steps.rustup-cache.outputs.cache-hit != 'true' | ||
with: | ||
toolchain: "${{ inputs.rust-toolchain }}" | ||
components: clippy, rustfmt | ||
- name: Rust Dependency Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
shared-key: "shared" # To allow reuse across jobs | ||
|
||
- name: Rust Compile Cache | ||
uses: mozilla-actions/[email protected] | ||
- name: Rust Compile Cache Config | ||
shell: bash | ||
run: | | ||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV | ||
- name: Rust Build | ||
shell: bash | ||
run: cargo build --all-targets | ||
|
||
- name: Export Path | ||
shell: bash | ||
run: echo "PATH=$PATH" >> $GITHUB_ENV |
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,23 @@ | ||
name: 'Setup Zig' | ||
description: 'Toolchain setup and Initial compilation' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Zig Version | ||
id: zig-version | ||
shell: bash | ||
run: echo "version=$(cat .zig-version | tr -d '\n ')" >> $GITHUB_OUTPUT | ||
|
||
- name: Zig Setup | ||
uses: goto-bus-stop/setup-zig@v2 | ||
with: | ||
version: "${{ steps.zig-version.outputs.version }}" | ||
|
||
# TODO(ngates): should we cache zig-cache? Or zig-out? | ||
- name: Zig Build | ||
shell: bash | ||
run: zig build | ||
|
||
- name: Export Path | ||
shell: bash | ||
run: echo "PATH=$PATH" >> $GITHUB_ENV |
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,42 @@ | ||
name: PR Benchmarks | ||
|
||
on: | ||
pull_request: | ||
types: [ labeled, synchronize ] | ||
branches: [ "develop" ] | ||
workflow_dispatch: { } | ||
|
||
permissions: | ||
actions: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
bench: | ||
runs-on: ubuntu-latest-large | ||
if: ${{ contains(github.event.head_commit.message, '[benchmark]') || github.event.label.name == 'benchmark' && github.event_name == 'pull_request' }} | ||
steps: | ||
# We remove the benchmark label first so that the workflow can be re-triggered. | ||
- uses: actions-ecosystem/action-remove-labels@v1 | ||
with: | ||
labels: benchmark | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-zig | ||
- uses: ./.github/actions/setup-rust | ||
|
||
- name: Bench - Vortex | ||
run: cargo bench | tee bench.txt | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/[email protected] | ||
with: | ||
name: Vortex Benchmarks | ||
tool: cargo | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
output-file-path: bench.txt | ||
summary-always: true | ||
auto-push: true | ||
fail-on-alert: false | ||
|
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,35 @@ | ||
name: Benchmarks | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
workflow_dispatch: { } | ||
|
||
permissions: | ||
actions: read | ||
contents: write | ||
deployments: write | ||
|
||
jobs: | ||
bench: | ||
runs-on: ubuntu-latest-large | ||
if: ${{ github.event_name == 'workflow_dispatch' || (contains(github.event.head_commit.message, '[benchmark]') && github.ref_name == 'develop') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/actions/setup-zig | ||
- uses: ./.github/actions/setup-rust | ||
|
||
- name: Bench - Vortex | ||
run: cargo bench | tee bench.txt | ||
|
||
- name: Store benchmark result | ||
uses: benchmark-action/[email protected] | ||
with: | ||
name: Vortex Benchmarks | ||
tool: cargo | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
output-file-path: bench.txt | ||
summary-always: true | ||
auto-push: true | ||
fail-on-alert: false |
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,46 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
pull_request: | ||
branches: [ "develop" ] | ||
workflow_dispatch: { } | ||
|
||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: 'build' | ||
runs-on: ubuntu-latest-medium | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup-zig | ||
- uses: ./.github/actions/setup-rust | ||
- uses: ./.github/actions/setup-python | ||
|
||
- name: Python Lint - Format | ||
run: rye run ruff format --check . | ||
- name: Python Lint - Ruff | ||
run: rye run ruff . | ||
|
||
- name: Rust Lint - Format | ||
run: cargo fmt --all --check | ||
- name: Rust Lint - Clippy | ||
run: cargo clippy --all-targets | ||
|
||
- name: Zig Lint - Fmt | ||
run: zig fmt --check zig/ | ||
|
||
- name: Rust Test | ||
run: cargo test --all | ||
|
||
- name: Zig Test | ||
run: zig build test | ||
|
||
- name: Pytest - PyEnc | ||
run: rye run pytest --benchmark-disable test/ | ||
working-directory: pyenc/ | ||
|
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
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
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
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.