Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[!src/llvm-project]
indent_style = space
indent_size = 4

[*.rs]
max_line_length = 100

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
31 changes: 31 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: cleanup

on:
pull_request:
types:
- closed

jobs:
cache_cleanup:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
-
name: Cleanup
run: |
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
15 changes: 8 additions & 7 deletions .github/workflows/crates.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: release

concurrency:
concurrency:
cancel-in-progress: false
group: ${{ github.workflow }}-${{ github.ref }}

Expand All @@ -9,8 +9,6 @@ env:
RUST_BACKTRACE: full

on:
release:
types: [ published ]
repository_dispatch:
types: [ crates-io ]
workflow_dispatch:
Expand All @@ -28,6 +26,7 @@ permissions:

jobs:
crates-io:
if: github.event.inputs.environment == 'crates-io' || github.event_name == 'repository_dispatch'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
environment:
Expand All @@ -37,7 +36,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
package:
package:
- concision-utils
- concision-core
- concision-data
Expand All @@ -46,18 +45,20 @@ jobs:
- concision-macros
- concision
# non-sdk packages
- concision-kan
- concision-s4
- concision-transformer
- concision-ext
runs-on: ubuntu-latest
steps:
-
-
name: Checkout
uses: actions/checkout@v4
-
-
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-
-
name: Publish (${{ matrix.package }})
run: cargo publish --locked --package ${{ matrix.package }}
63 changes: 63 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: release

on:
release:
types: [ published ]
repository_dispatch:
types: [ release ]
workflow_dispatch:
inputs:
draft:
default: false
description: 'Create a draft release'
required: true
type: boolean
prerelease:
default: false
description: 'Create a prerelease'
required: true
type: boolean

permissions:
contents: write
discussions: write

jobs:
publish:
environment:
name: crates-io
url: https://crates.io/crates/${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- name: Trigger target workflow
uses: peter-evans/repository-dispatch@v3
with:
event-type: crates-io
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
token: ${{ github.token }}
release:
continue-on-error: true
needs: publish
env:
IS_PRERELEASE: ${{ github.event.inputs.prerelease || false }}
IS_DRAFT: ${{ github.event.inputs.draft || false }}
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Create release
uses: softprops/action-gh-release@v1
with:
append_body: false
draft: ${{ env.IS_DRAFT }}
prerelease: ${{ env.IS_PRERELEASE }}
tag_name: ${{ github.event.release.tag_name }}
body: |
${{ github.event.release.body }}

## Links

- [crates.io](https://crates.io/crates/${{ github.event.repository.name }})
- [docs.rs](https://docs.rs/${{ github.event.repository.name }})
104 changes: 31 additions & 73 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
workflow_dispatch:
inputs:
benchmark:
default: true
default: false
description: 'Run benchmarks'
required: true
type: boolean
Expand All @@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [x86_64-unknown-linux-gnu] # [ x86_64-unknown-linux-gnu, x86_64-apple-darwin, x86_64-pc-windows-msvc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2 ]
target: [ x86_64-unknown-linux-gnu ]
steps:
-
name: Checkout
Expand All @@ -53,16 +53,20 @@ jobs:
target: ${{ matrix.target }}
-
name: Build the workspace
run: cargo build -r --locked --workspace --all-features --target ${{ matrix.target }}
benchmark:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event.action == 'repository_dispatch' && github.event.action == 'rust' || github.event_name == 'workflow_dispatch' && github.event.inputs.benchmark
run: cargo build --release --locked --workspace --all-features --target ${{ matrix.target }}
benchmark:
if: github.event_name == 'repository_dispatch' || github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') || github.event.inputs.benchmark == 'true'
needs: build
runs-on: ubuntu-latest
outputs:
results: ${{ steps.artifacts.outputs.artifact-id }}
permissions:
contents: write
checks: write
strategy:
fail-fast: false
matrix:
package: [ concision ]
target: [ x86_64-unknown-linux-gnu ] # [ x86_64-unknown-linux-gnu, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2 ]
features: [ full ]
steps:
-
name: Checkout
Expand All @@ -72,18 +76,26 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
target: ${{ matrix.target }}
-
name: Benchmark (${{ matrix.package }})
run: cargo bench -v --locked --features full --package ${{ matrix.package }} --target ${{ matrix.target }}
name: Benchmark (${{ matrix.features }})
run: cargo bench --locked --verbose --workspace --features ${{ matrix.features }} --
-
name: Upload the benchmarks
id: artifacts
uses: actions/upload-artifact@v4
with:
name: benchmarks@${{ github.sha }}
if-no-files-found: error
overwrite: true
path: target/criterion/
test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features: [ full ]
target: [ x86_64-unknown-linux-gnu ] # [ x86_64-unknown-linux-gnu, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2 ]
features: [ default, full ] # [ all, default, full ]
toolchain: [ stable ] # [ stable, nightly ]
steps:
-
name: Checkout
Expand All @@ -92,72 +104,18 @@ jobs:
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
target: ${{ matrix.target }}
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
toolchain: ${{ matrix.toolchain }}
override: true
-
if: matrix.features != 'default' && matrix.features != 'all'
name: Test (${{ matrix.features }})
run: cargo test -r --locked --workspace --target ${{ matrix.target}} --features ${{ matrix.features }}
test_std:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
features: [ default ] # [ default, all ]
target: [ x86_64-unknown-linux-gnu ]
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
target: ${{ matrix.target }}
-
if: matrix.features == 'all'
name: Setup blas
run: |
sudo apt-get update -y
sudo apt-get install -y libopenblas-dev liblapack-dev
run: cargo test -r --locked --workspace --features ${{ matrix.features }}
-
if: matrix.features == 'default'
name: Test (default)
run: cargo test -r --locked --workspace --target ${{ matrix.target}}
run: cargo test -r --locked --workspace
-
if: matrix.features == 'all'
name: Test (all-features)
run: cargo test -r --locked --workspace --target ${{ matrix.target}} --all-features
test_no_std:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.no_std || github.event_name == 'repository_dispatch' && github.event.action == 'rust'
continue-on-error: true
needs: build
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C panic=abort -Z panic_abort_tests"
strategy:
fail-fast: false
matrix:
features: [ alloc, no_std ]
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
toolchain: nightly
override: true
-
if: matrix.features != 'no_std'
continue-on-error: true
name: Test (${{ matrix.features }})
run: cargo test -r --locked --workspace --no-default-features --features ${{ matrix.features }}
-
if: matrix.features == 'no_std'
continue-on-error: true
name: Test (no_std)
run: cargo test -r --locked --workspace --no-default-features
run: cargo test -r --locked --workspace --all-features
Loading