Update github workflows
This commit is contained in:
parent
f787368f98
commit
093be7b7b8
33
.github/workflows/benchmark.yml
vendored
Normal file
33
.github/workflows/benchmark.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
name: Benchmark
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Setup Rust
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Run benchmark
|
||||
run: cargo +nightly test | tee output.txt
|
||||
- name: Fetch gh-pages for avoiding conflict
|
||||
run: git fetch 'https://dalance:${{ secrets.GITHUB_TOKEN }}@github.com/dalance/sv-parser.git' gh-pages:gh-pages
|
||||
- name: Store benchmark result
|
||||
uses: rhysd/github-action-benchmark@v1
|
||||
with:
|
||||
name: Rust Benchmark
|
||||
tool: 'cargo'
|
||||
output-file-path: output.txt
|
||||
- name: Push benchmark result
|
||||
run: git push 'https://dalance:${{ secrets.GITHUB_TOKEN }}@github.com/dalance/sv-parser.git' gh-pages:gh-pages
|
25
.github/workflows/periodic.yml
vendored
Normal file
25
.github/workflows/periodic.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
name: Periodic
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 0 * * SUN
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable, beta, nightly]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Setup Rust
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Run tests
|
||||
run: cargo test
|
23
.github/workflows/regression.yml
vendored
Normal file
23
.github/workflows/regression.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: Regression
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
rust: [stable]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- name: Setup Rust
|
||||
uses: hecrj/setup-rust-action@v1
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
- name: Run tests
|
||||
run: cargo test
|
13
.github/workflows/test.yml
vendored
13
.github/workflows/test.yml
vendored
@ -1,13 +0,0 @@
|
||||
name: Test
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
@ -349,7 +349,7 @@ pub struct PsOrHierarchicalNetIdentifierPackageScope {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
pub struct PsOrHierarchicalNetIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalNetIdentifier),
|
||||
pub nodes: (HierarchicalNetIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
@ -365,7 +365,7 @@ pub struct PsOrHierarchicalPropertyIdentifierPackageScope {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
pub struct PsOrHierarchicalPropertyIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalPropertyIdentifier),
|
||||
pub nodes: (HierarchicalPropertyIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
@ -381,7 +381,7 @@ pub struct PsOrHierarchicalSequenceIdentifierPackageScope {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
pub struct PsOrHierarchicalSequenceIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalSequenceIdentifier),
|
||||
pub nodes: (HierarchicalSequenceIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
@ -400,7 +400,7 @@ pub struct PsOrHierarchicalTfIdentifierPackageScope {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
pub struct PsOrHierarchicalTfIdentifierHierarchical {
|
||||
pub nodes: (HierarchicalTfIdentifier),
|
||||
pub nodes: (HierarchicalTfIdentifier,),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Node)]
|
||||
|
@ -35,5 +35,5 @@ structopt = "0.3.2"
|
||||
criterion = "0.3"
|
||||
|
||||
[[bench]]
|
||||
name = "parse_sv"
|
||||
name = "parse_sv_criterion"
|
||||
harness = false
|
||||
|
37
sv-parser/benches/parse_sv_bench.rs
Normal file
37
sv-parser/benches/parse_sv_bench.rs
Normal file
@ -0,0 +1,37 @@
|
||||
#![feature(test)]
|
||||
|
||||
extern crate test;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
use sv_parser::parse_sv;
|
||||
use test::Bencher;
|
||||
|
||||
fn get_path(s: &str) -> PathBuf {
|
||||
PathBuf::from(format!(
|
||||
"{}/testcases/{}",
|
||||
env::var("CARGO_MANIFEST_DIR").unwrap(),
|
||||
s
|
||||
))
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn test1(b: &mut Bencher) {
|
||||
let defines = HashMap::new();
|
||||
let includes: Vec<PathBuf> = Vec::new();
|
||||
let path = get_path("test1.sv");
|
||||
b.iter(|| {
|
||||
let _ = parse_sv(&path, &defines, &includes);
|
||||
});
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn test2(b: &mut Bencher) {
|
||||
let defines = HashMap::new();
|
||||
let includes: Vec<PathBuf> = Vec::new();
|
||||
let path = get_path("test2.sv");
|
||||
b.iter(|| {
|
||||
let _ = parse_sv(&path, &defines, &includes);
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user