-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit f3f8640
Showing
27 changed files
with
955 additions
and
0 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,11 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
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,153 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
schedule: | ||
- cron: "32 4 * * 5" | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Fmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: nightly | ||
components: rustfmt | ||
|
||
- name: fmt | ||
run: cargo fmt -- --check | ||
|
||
CargoSort: | ||
name: Check order in Cargo.toml | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-sort | ||
- run: cargo sort --workspace --grouped --check --check-format | ||
|
||
Build: | ||
needs: | ||
- Fmt | ||
- CargoSort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Compile project | ||
run: cargo build --bench template-benchmark --release | ||
|
||
Clippy: | ||
needs: | ||
- Fmt | ||
- CargoSort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: clippy | ||
run: cargo clippy -- -D warnings | ||
|
||
Audit: | ||
needs: | ||
- Fmt | ||
- CargoSort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Audit | ||
uses: actions-rs/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
DevSkim: | ||
needs: | ||
- Fmt | ||
- CargoSort | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run DevSkim scanner | ||
uses: microsoft/DevSkim-Action@v1 | ||
|
||
- name: Upload DevSkim scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: devskim-results.sarif | ||
|
||
deploy: | ||
if: github.ref == 'refs/heads/main' | ||
needs: | ||
- Build | ||
- Clippy | ||
- Audit | ||
- DevSkim | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: sudo apt install -y gnuplot | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: stable | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- run: rm -rf target/criterion | ||
|
||
- name: Run benchmarks | ||
run: cargo bench --bench template-benchmark | ||
|
||
- name: Fixup paths | ||
run: sed -e 's,href="../,href=",' < target/criterion/report/index.html > target/criterion/index.html | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: 'target/criterion' | ||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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,2 @@ | ||
target | ||
Cargo.lock |
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,8 @@ | ||
edition = "2021" | ||
group_imports = "StdExternalCrate" | ||
imports_granularity = "Module" | ||
newline_style = "Unix" | ||
normalize_comments = true | ||
unstable_features = true | ||
use_field_init_shorthand = true | ||
version = "Two" |
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,43 @@ | ||
[workspace] | ||
members = [ | ||
".", | ||
"tmpls", | ||
"tmpls/askama", | ||
"tmpls/markup", | ||
"tmpls/minijinja", | ||
"tmpls/rinja", | ||
"tmpls/tinytemplate", | ||
] | ||
resolver = "2" | ||
|
||
[package] | ||
name = "template-benchmark" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
license = "Apache-2.0" | ||
|
||
[features] | ||
default = ["askama", "markup", "minijinja", "rinja", "tinytemplate"] | ||
askama = ["dep:askama"] | ||
markup = ["dep:markup"] | ||
minijinja = ["dep:minijinja"] | ||
rinja = ["dep:rinja"] | ||
tinytemplate = ["dep:tinytemplate"] | ||
|
||
[dependencies] | ||
tmpls = { version = "*", path = "tmpls" } | ||
|
||
askama = { version = "*", optional = true, path = "tmpls/askama", package = "tmpl-askama" } | ||
markup = { version = "*", optional = true, path = "tmpls/markup", package = "tmpl-markup" } | ||
minijinja = { version = "*", optional = true, path = "tmpls/minijinja", package = "tmpl-minijinja" } | ||
rinja = { version = "*", optional = true, path = "tmpls/rinja", package = "tmpl-rinja" } | ||
tinytemplate = { version = "*", optional = true, path = "tmpls/tinytemplate", package = "tmpl-tinytemplate" } | ||
|
||
ahash = { version = "0.8.11", features = ["no-rng"] } | ||
criterion = { version = "0.5.1", features = ["html_reports"] } | ||
quanta = "0.12.3" | ||
|
||
[[bench]] | ||
name = "template-benchmark" | ||
harness = false |
Oops, something went wrong.