-
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
1 parent
088e0de
commit ec5e8b9
Showing
12 changed files
with
333 additions
and
124 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 |
---|---|---|
@@ -1,31 +1,41 @@ | ||
name: Benches | ||
name: Rust benches | ||
|
||
on: | ||
push: | ||
branches: [ main, develop ] | ||
|
||
workflow_call: | ||
inputs: | ||
toolchain: | ||
description: 'rust toolchain' | ||
required: false | ||
default: 'stable' | ||
type: string | ||
# options: | ||
# - stable | ||
# - nightly | ||
# - beta | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
bench: | ||
name: Run benches for Lattice QCD rs | ||
name: Run criterion benches | ||
runs-on: ubuntu-latest | ||
# env: | ||
# CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Rust stable toolchain | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
toolchain: ${{ inputs.toolchain }} | ||
default: true | ||
|
||
- name: Run benchmarks | ||
run: | | ||
# run benchmarks and save baseline in a directory called "new" | ||
cargo bench | ||
run: cargo bench --verbose | ||
|
||
# - name: Upload benchmarks | ||
# env: | ||
# CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }} | ||
# run: | | ||
# # upload the files | ||
# bash <(curl -s https://criterion.dev/bash) |
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,39 @@ | ||
name: clippy check | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
features_flag: | ||
description: 'feature flag used on the cargo command' | ||
required: false | ||
default: '--all-features' | ||
type: string | ||
toolchain: | ||
description: 'rust toolchain' | ||
required: false | ||
type: string | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
linter: | ||
name: lint code with clippy on nightly | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ inputs.toolchain }} | ||
components: cargo, clippy | ||
default: true | ||
|
||
- name: Linter | ||
run: cargo clippy --all --verbose --all-targets ${{ inputs.features_flag }} -- --no-deps --deny warnings | ||
|
||
- name: Linter release | ||
run: cargo clippy --all --verbose --all-targets --release ${{ inputs.features_flag }} -- --no-deps --deny warnings |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,93 @@ | ||
name: Rust | ||
name: Rust checks | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: [ main, develop ] | ||
# pull_request: | ||
# branches: [ main, develop ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
format: | ||
name: check the format of the code | ||
uses: ./.github/workflows/fmt.yml | ||
|
||
rustdoc-check: | ||
name: rustdoc check | ||
uses: ./.github/workflows/rust_doc_check.yml | ||
with: | ||
toolchain: stable | ||
|
||
rust_test: | ||
name: rust test | ||
needs: [format] | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
profile: [test, release] | ||
exclude: | ||
- os: windows-latest | ||
profile: release | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
uses: ./.github/workflows/rust_test.yml | ||
with: | ||
features_flag_1: --features="serde-serialize" | ||
features_flag_2: --no-default-features --features="overflow-test" | ||
toolchain: stable | ||
os: ${{ matrix.os }} | ||
profile: ${{ matrix.profile }} | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v4 | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
# - name: Install Rust stable toolchain | ||
# uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: stable | ||
# default: true | ||
|
||
- name: Run tests with serd | ||
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" | ||
# - name: Run tests with serd | ||
# run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" | ||
|
||
- name: Run examples tests with serd | ||
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples | ||
# - name: Run examples tests with serd | ||
# run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples | ||
|
||
# it is faster to keep the going and reuse previous compilation artefact than using | ||
# a matrix strategy and starting all over again | ||
- name: Run tests no features | ||
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" | ||
# - name: Run tests no features | ||
# run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" | ||
|
||
- name: Run examples tests no features | ||
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples | ||
# - name: Run examples tests no features | ||
# run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples | ||
|
||
linter: | ||
name: lint code on nightly release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust nightly toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
components: clippy | ||
default: true | ||
|
||
- name: Linter | ||
run: cargo +nightly clippy --all --verbose --tests --all-features -- --no-deps --deny warnings | ||
|
||
- name: Linter release | ||
run: cargo +nightly clippy --all --verbose --tests --release --all-features -- --no-deps --deny warnings | ||
needs: [format, rustdoc-check] | ||
uses: ./.github/workflows/clippy.yml | ||
with: | ||
features_flag: --all-features | ||
toolchain: nightly | ||
|
||
coverage: | ||
name: coverage | ||
uses: ./.github/workflows/coverage.yml | ||
with: | ||
profile_file_name_prefix: lattice-qcd-rs | ||
features_flag: --no-default-features --features="serde-serialize" | ||
|
||
benches: | ||
name: benches | ||
needs: [format, coverage, rust_test] | ||
if: ${{ github.ref_name == 'main' || github.ref_name == 'develop' }} | ||
uses: ./.github/workflows/benches.yml | ||
with: | ||
toolchain: stable | ||
|
||
doc_publish: | ||
name: publish rust doc | ||
needs: [format, coverage, rust_test, rustdoc-check, linter] | ||
if: ${{ github.ref_name == 'main' }} | ||
uses: ./.github/workflows/rust_doc_publish.yml | ||
with: | ||
toolchain: stable |
This file was deleted.
Oops, something went wrong.
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.