Skip to content

Commit

Permalink
Add CI for veryl_std
Browse files Browse the repository at this point in the history
  • Loading branch information
dalance committed Sep 2, 2024
1 parent f07f783 commit b7993c9
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 29 deletions.
60 changes: 31 additions & 29 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,70 @@ jobs:
- os: ubuntu-latest
rust: stable
target: x86_64-unknown-linux-gnu
use-cross: false
- os: macOS-latest
rust: stable
target: x86_64-apple-darwin
use-cross: false
- os: windows-latest
rust: stable
target: x86_64-pc-windows-msvc
use-cross: false

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Run tests
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use-cross }}
command: test
args: --locked --target ${{ matrix.target }}
run: cargo test --locked --target ${{ matrix.target }}

rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- uses: Swatinem/rust-cache@v2
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
run: cargo fmt -- --check

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
profile: minimal
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Run clippy
uses: actions-rs/cargo@v1
run: cargo clippy -- -D warnings

std:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
command: clippy
args: -- -D warnings
submodules: 'true'
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup veryl
run: cargo install --path crates/veryl
- name: Setup verilator
uses: veryl-lang/setup-verilator@v1
- name: Format check
run: veryl fmt --check
working-directory: crates/std/veryl
- name: Build check
run: veryl check
working-directory: crates/std/veryl
- name: Test
run: veryl test --sim verilator
working-directory: crates/std/veryl
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ veryl_testcase.*
/book/po/*~
/testcases/map/dependencies/
/crates/metadata/std/
/crates/std/veryl/*.f
/crates/std/veryl/target/
3 changes: 3 additions & 0 deletions crates/std/veryl/Veryl.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is automatically @generated by Veryl.
# It is not intended for manual editing.
projects = []
44 changes: 44 additions & 0 deletions crates/std/veryl/Veryl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[project]
name = "std"
version = "0.0.1"
authors = ["dalance@gmail.com"]
description = "Veryl Standard Library"
license = "MIT OR Apache-2.0"
repository = "https://github.com/veryl-lang/std"

[build]
target = {type = "directory", path = "target/src"}
exclude_std = true

[lint.naming]
case_enum = "snake"
case_function = "snake"
case_instance = "snake"
case_interface = "snake"
case_modport = "snake"
case_module = "snake"
case_package = "snake"
case_parameter = "screaming_snake"
case_port_inout = "snake"
case_port_input = "snake"
case_port_modport = "snake"
case_port_output = "snake"
case_reg = "snake"
case_struct = "snake"
case_union = "snake"
case_var = "snake"
case_wire = "snake"
prefix_port_input = "i"
prefix_port_output = "o"

[doc]
path = "target/doc"

[test]
waveform_target = {type = "directory", path = "target/wave"}

[test.vcs]
compile_args = ["-full64"]

[test.verilator]
compile_args = ["-Wno-MULTIDRIVEN", "-Wno-WIDTHTRUNC", "-Wno-WIDTHEXPAND"]

0 comments on commit b7993c9

Please sign in to comment.