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
55 changes: 55 additions & 0 deletions .github/workflows/cargo-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Benchmark

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

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full

on:
repository_dispatch:
types: [ cargo-bench, benchmark ]
workflow_dispatch:

permissions:
checks: write
contents: write

jobs:
benchmark:
runs-on: ubuntu-latest
outputs:
digest: ${{ steps.artifacts.outputs.artifact-digest }}
id: ${{ steps.artifacts.outputs.artifact-id }}
url: ${{ steps.artifacts.outputs.artifact-url }}
strategy:
fail-fast: false
matrix:
target: [ x86_64-unknown-linux-gnu ]
toolchain: [ stable ]
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 }}
toolchain: ${{ matrix.toolchain }}
override: true
-
name: Benchmark the workspace
run: cargo bench --locked --workspace --target ${{ matrix.target }} --features full --verbose --
-
name: Upload the benchmarks
id: artifacts
uses: actions/upload-artifact@v4
with:
name: Benchmark Report (${{ github.event.repository.name }})
if-no-files-found: error
overwrite: true
path: target/criterion/
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: clippy
name: Clippy

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

Expand All @@ -10,35 +10,33 @@ env:

on:
pull_request:
branches: [ main, master ]
branches:
- main
- $default-branch
types: [ opened, reopened, synchronize ]
paths:
- "**/clippy.yml"
- "**/*.rs"
- "**/Cargo.*"
push:
branches: [ main, master ]
tags: [ latest, v*.*.*, "*-nightly" ]
paths:
- "**/clippy.yml"
- "**/*.rs"
- "**/Cargo.*"
branches:
- main
- $default-branch
tags:
- v*.*.*
- "*-nightly"
release:
types: [ created, edited ]
repository_dispatch:
types: [ clippy ]
types: [ clippy, cargo-clippy ]
workflow_dispatch:

jobs:
clippy:
runs-on: ubuntu-latest
permissions:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
contents: read
security-events: write
statuses: write
steps:
-
-
name: Checkout
uses: actions/checkout@v4
-
Expand All @@ -47,17 +45,19 @@ jobs:
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
components: clippy, rustfmt
-
override: true
toolchain: nightly
-
name: Setup the for sarif output
run: cargo install clippy-sarif sarif-fmt
-
-
name: Run Clippy
run:
cargo clippy
--all-features
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
continue-on-error: true
-
-
name: Upload analysis
uses: github/codeql-action/upload-sarif@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

on:
repository_dispatch:
types: [ crates-io ]
types: [ cargo-publish, crates-io ]
workflow_dispatch:

permissions:
Expand All @@ -31,7 +31,7 @@ jobs:
max-parallel: 1
fail-fast: false
matrix:
package:
package:
- scsys-traits
- scsys-util
- scsys-core
Expand All @@ -42,15 +42,15 @@ jobs:
- scsys
runs-on: ubuntu-latest
steps:
-
-
uses: actions/checkout@v4
name: Checkout
-
-
uses: actions-rust-lang/setup-rust-toolchain@v1
name: Setup Rust
with:
cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-
-
name: Publish (${{ matrix.package }})
run: cargo publish --locked --package ${{ matrix.package }}
id: publish
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
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Release

on:
release:
Expand All @@ -19,37 +19,37 @@ on:
type: boolean

permissions:
actions: read
actions: read
contents: write
discussions: write

jobs:
publish:
environment:
environment:
name: crates-io
url: https://crates.io/crates/${{ github.event.repository.name }}
url: https://crates.io/crates/scsys
runs-on: ubuntu-latest
steps:
-
-
name: Publish to crates.io
uses: peter-evans/repository-dispatch@v3
uses: peter-evans/repository-dispatch@v3
with:
event-type: crates-io
event-type: cargo-publish
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
token: ${{ github.token }}
release:
needs: publish
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
uses: softprops/action-gh-release@v2
with:
append_body: false
draft: ${{ env.IS_DRAFT }}
Expand Down
Loading
Loading